Questions tagged [xpath-1.0]

Use this tag for questions specific to XML Path Language (XPath) version 1.0

W3C Recommendation:


Online Training

A 70-minutes "Crash Course in XPath" module is available as part of the Pluralsight video-course "XSLT 2.0 and 1.0 Foundations", by Dimitre Novatchev


410 questions
2
votes
1 answer

XPath 1.0, 1st node in subtree

So what I want to do is identify the 1st node in some subtree of a xml tree. here's an example
MrD at KookerellaLtd
  • 2,412
  • 1
  • 15
  • 17
2
votes
1 answer

driver.find_elements_by_xpath('//div[@data-testid="tweet"]') gives No Output

I am trying to scrape tweets using twitter scraper I have tried a lot of solutions but it gives out empty list. driver.find_elements_by_xpath('//div[@data-testid="tweet"]') Whole chunk: cards =…
at_514
  • 23
  • 3
2
votes
1 answer

How to Use Functions in Xpath 1.0

Im using xmllint --xpath which supports only XPath 1.0. I know XPath 1.0 supports functions like concat() : https://www.w3.org/TR/1999/REC-xpath-19991116/ But I get errors like below when I try to use them in an XPath in orders to extract content…
Sony Antony
  • 314
  • 1
  • 11
2
votes
2 answers

Click button in a table on a specific row in Python Selenium

I have a page with a table and few rows where some rows have same texts as the other rows. I want to click on a button "Delete" if text on the same row contains the text "real" in real .
bbfl
  • 277
  • 1
  • 2
  • 16
2
votes
2 answers

XPath using classname and contains text

I was looking for an answer to how to find an element that has a class and contains text. I've got two answers. //div[@class='credit_summary_item' and contains(text(),'Professor']: as in HTML XPath Searching by class and text //div[contains(@class,…
Hesoti
  • 87
  • 1
  • 8
2
votes
2 answers

XPath for all elements not with certain parent

Let's say I have the following XML:
2
votes
1 answer

Extracting all the text between two tags(bold) using XPATH

This is my HTML element ,

Introduction. Against the backdrop of increasing resistance to conventional antibiotics, bacteriocins represent an attractive…

2
votes
3 answers

How to get Absolute XPath in Chrome or Firefox

I need to get absolute Xpath and not the relative one. I need something like this: html/body/div[1]/section/div[1]/div/div/div/div[1]/div/div/div/div/div[3]/div[1]/div/h4[1]/b On both browsers when I inspect the code and I use right click ->…
qa testing
  • 51
  • 1
  • 3
2
votes
1 answer

How to search for empty/void nodes/elements in XPath?

I have the following XML sample for which I need a XPath query to return only node1 and node3. anyText
Teodor Tite
  • 1,855
  • 3
  • 24
  • 31
2
votes
4 answers

How to extract the texts one by one between

and span tags

I am trying to get texts which are named as text1,text2,text3,text4 one by one.

"TEXT1"

"TEXT2"
"TEXT3"
"TEXT4"

When I try to use div.element>p>span with css…
2
votes
4 answers

How to deal with single and double quotes in xpath in Python

I have an XPath which has a single quote in XPath which is causing a SyntaxError: error. I've tried with escape sequence: xpath = "//label[contains(text(),'Ayuntamiento de la Vall d'Uixó - Festivales Musix')]" But I am still facing an…
2
votes
2 answers

XPath syntax, with or without "/text()" suffix

From different websites, the XPath syntax provided are different, primarily the need of the "/text()" suffix. Citing syntax without the need of suffix: https://www.w3schools.com/xml/xpath_syntax.asp https://www.javatpoint.com/xpath-syntax Citing…
2
votes
1 answer

How do I find distinct nodes in an XML with XPath 1.0 when I need to take the content of two xml nodes into account

This is my first question here. I am trying to create a xslt that transforms XML to Text. I need to find the distinct list of the LANG and OFFICEID concatenation, that can then be used in a xsl:for-each loop I have created a minimal Version of the…
Jann
  • 23
  • 3
2
votes
2 answers

selenium using python: how to correctly click() an element?

while learning how to use selenium, Im trying to click an element but nothing happens and Im unable to reach the next page. this is the relevant page: http://buyme.co.il and Im trying to click: הרשמה I managed to print the desired element (הרשמה) so…
holder
  • 93
  • 1
  • 10