Escape colon in Xpath search
I use Hpricot with selenium. I have this html input element:
<input id="foo:bar"/>
And I'm trying to get this value using this Xpath expression:
source = Hpricot(@selenium.get_html_source)
source.search("//input[@id='foo:bar']")
but he finds nothing because of the colon. I saw that the Xpath expression cannot contain any colon. I tried to avoid this in different ways, but it does not work.
Is there any way to avoid this or avoid this problem? I cannot change the values ββin html, so foo: bar should be this way with a colon. But I need to somehow find this element.
Any ideas?
thank
, , get_element_by_id.
, :
source = Hpricot(@selenium.get_html_source)
source.get_element_by_id("foo:bar")
, .