xpath Questions

5

Solved

I am performing a search in an XML file, using the following code: $result = $xml->xpath("//StopPoint[contains(StopName, '$query')]"); Where $query is the search query, and StopName is the na...
News asked 9/3, 2009 at 12:12

2

Solved

I have an array of Elements and I want them in document order. I know this is trivial to achieve in XPath, but the logic I have to implement is a bit complicated for a single expression. I did fin...
Eliaeliades asked 13/8, 2015 at 14:34

2

Solved

I have the following code, whose last line results in a NotSupportedException on every execution, and I haven't found a way around it. This hypothetical analogous code finds a "book" with a specifi...
Dragone asked 21/10, 2009 at 15:48

3

Solved

You can verify an XPath expression against an XML doc to verify it, but is there an easy way to verify the same XPath expression against the schema for that document? Say I have an XSD schema like...
Raines asked 21/3, 2009 at 5:42

8

Solved

I tried to locate use element with attribute value '#aaa' for below snippet <svg> <use xlink:href='#aaa'></use> </svg> I was able to locate using css selector use[* |hre...
Xenophanes asked 18/9, 2017 at 6:45

5

Below is the html for SVG, pls help me with creating XPATH for same <svg data-reactid=".1q.0.3.1.0" version="1.1" class="svg-connector"> <circle data-reactid=".1q.0.3.1.0.0" r="7" cy="11...
Stelle asked 28/2, 2018 at 7:24

4

Solved

Given the following xml: <foo bar="&foobar">some text</foo> I need to get the value of the bar attribute without it being unescaped. Every method I've tried thus far in Power...
Boniface asked 20/12, 2012 at 15:8

2

Solved

I'm relatively new to using Chrome developer tools/doing XPath searches/this kind of programming in general, so please excuse any incorrect terminology or vague-sounding descriptions. I think the s...
Decalescence asked 7/12, 2016 at 20:12

4

Solved

for example i have an xpath and wish to add a comment near it to identify it. /html/body/div/table/tr/td/a{this is a link}
Cabdriver asked 4/11, 2009 at 21:4

3

In the function below, when string in $keyword contains double quotes, it does create a "Warning: DOMXPath::evaluate(): Invalid expression": $keyword = 'This is "causing" an error'; $xPath->eva...
Vallee asked 27/1, 2011 at 18:3

8

Solved

I use XPather Browser to check my XPATH expressions on an HTML page. My end goal is to use these expressions in Selenium for the testing of my user interfaces. I got an HTML file with a content s...
Illdefined asked 29/10, 2008 at 15:0

4

Solved

I am trying to extract the link inside a href but all I am finding it is the text inside the element The website code is the following: <div class="item-info-container "> <a hre...
Syverson asked 6/7, 2023 at 1:10

19

Solved

Is there a package out there, for Ubuntu and/or CentOS, that has a command-line tool that can execute an XPath one-liner like foo //element@attribute filename.xml or foo //element@attribute < fi...
Support asked 17/3, 2013 at 14:16

4

Solved

Is there any way to locate parent element in CSS Selector? i am using below code but i am not getting the parent element. WebElement we=dr.findElement(By.cssSelector("div[id='gf-BIG']:parent")); ...
Vassalage asked 23/6, 2015 at 4:28

2

I need an Xpath expression that will select values that start with a certain value. For this instance I am using the id field. @id=[starts-with(name(),'value') The following does not work. Is ther...
Godthaab asked 17/5, 2013 at 10:31

2

Solved

I want to parse HTML with lxml using XPath expressions. My problem is matching for the contents of a tag: For example given the <a href="http://something">Example</a> element...
Stutsman asked 14/4, 2010 at 13:35

3

Solved

I want to click or more respectively, expand the "Any time" button. I've tried to locate the element by class_name and xpath. The problem is that the class and xpath are the same for all three 'opt...
Clem asked 10/10, 2017 at 14:54

7

Solved

How would you get a JSON path to a given child node of an object? E.g.: var data = { key1: { children: { key2:'value', key3:'value', key4: { ... } }, key5: 'value' } An variable with a ...
Apothecium asked 9/1, 2012 at 15:16

8

Solved

Lets say I have the following xml (a quick example) <rows> <row> <name>one</name> </row> <row> <name>two</name> </row> </rows> I...
Lazare asked 28/11, 2011 at 16:36

3

Solved

I'm having trouble locating a span element in Selenium using java. the HTML looks like: <div class="settings-padding"> <span>Settings</span> </div> And I've ...
Virgulate asked 22/7, 2016 at 19:47

2

Solved

I am using selenium and I need to find the XPaths of some selenium web elements. For example: import selenium.webdriver driver = selenium.webdriver.Firefox() element = driver.find_element_by_xpa...
Brillatsavarin asked 25/6, 2014 at 14:43

5

Solved

I'm trying to use XPath to find an element containing a piece of text, but I can't get it to work.... WebElement searchItemByText = driver.findElement(By.xpath("//*[@id='popover-search']/div/d...
Bearce asked 15/4, 2014 at 8:28

5

Solved

How to count the number of elements are matching with for the given xpath expression xpath: driver.findElement(By.xpath("//div[contains(@id,'richedittext_instance')]")) all i need is the count. ...
Cowrie asked 8/2, 2013 at 6:17

7

Solved

How can I verify my XPath? I am using Chrome Developers tool to inspect the elements and form my XPath. I verify it using the Chrome plugin XPath Checker, however it does not always give me the re...
Edict asked 21/3, 2014 at 23:25

4

Solved

How can I get all tr elements without id attribute? <tr id="name">...</tr> <tr>...</tr> <tr>...</tr> Thanks
Frederickfredericka asked 8/3, 2010 at 19:34

© 2022 - 2024 — McMap. All rights reserved.