Questions tagged [xpath]

The primary purpose of XPath is to address parts of an XML document. It also provides basic facilities for manipulation of strings, numbers and booleans. XPath uses a compact, non-XML syntax. XPath operates on the abstract, logical structure of an XML document, rather than its surface syntax.

-2
votes
0answers
20 views

How to get the right Xpath for the <li> HTML element?

i should make Selenium to click on the element of drop down menu using Java and Inteliji. I should click on the "today" button. I tried to copy the xpath, use cssselector, i used extensions like xpath ...
0
votes
2answers
14 views

xpath is not able to identify the webelement

Following is the html of the element that I am trying to construct the xpath for: <div class="b-list-item" data-index="7" data-id="8"> Jong </div> I tried the following xpaths none of ...
0
votes
2answers
26 views

Input into hidden textbox and hit enter (Selenium, Python)

I'm trying to input the text string "L62T18H029-P3215" into the search input box on this website https://lamerfashion.com and press Enter. I have tried to execute some javascript to change the value ...
0
votes
1answer
16 views

Why's my xpath returning both tables despite specifying the index?

I am using the Fuzi Swift library for parsing this hackernews page. I need to extract only the top description of the post which contains the main post's details (i.e. "Maybe HN can help solve this ...
0
votes
2answers
31 views

Grabbing Correct Data from XML data (Using XSLT)

I am looking to grab data from multiple nodes, but am having trouble finding a way to make it work the way I want. Sample Data: <Records> <Record> <ID>100</ID> &...
0
votes
2answers
19 views

Get Node for XML with namespace using XPath

I am attempting to select a node based on a value in an element in an xml file that contains a namespace. I am using Automation Anywhere's Get XML Node command that limits me to using a single line ...
-1
votes
2answers
30 views

How to click on the button with Selenium C#

I need to use selenium to click on button but I'm Facing some problems I try this code but show me error "Selenium.InvalidSelectorException: 'invalid selector" IList link = driver.FindElements(By....
1
vote
1answer
23 views

How do I select unnamed node in HTML or XML using XPath?

I try to access the text inside the <dl> environment following the <p> environment with the text "Bedeutungen:" inside. I try to specify an XPath to select this specific <dl> node. &...
0
votes
1answer
25 views

SQL Server XML - modify multiple elements

I have a SQL Server XML column with data like this: <History> <Entry> ..... </Entry> <Entry> ..... </Entry> </History> I need to add a ...
1
vote
1answer
37 views

Click Drop Down Menu with Selenium in Python

I am trying to finish my script with clicking on my picture in the top corner which leads to a drop down menu where the log out button is located. I can get Selenium to recognize the picture and click ...
0
votes
0answers
15 views

Imported custom xpath-function does not seem in Jdeveloper for OSB 12c

I am importing custom xquery function to OSB 12c. I moved the resources these are jar file, custom-osb-xpath.xml and custom-osb-xpath.properties to "xpath-functions" folder. (C:\Oracle\osb\config\...
0
votes
0answers
11 views

selenium button click python

i coldnt click button contain javascript <div style="width:100%; float:left;"><div class="btn btn-search" onclick="javascript: search(); " style="cursor:pointer;width:100%" align="center">...
0
votes
2answers
31 views

Attempting to grab certain Elements

I am new to lxml module in Python. I am trying to parse data from a website: https://weather.com/weather/tenday/l/USCA1037:1:US I am trying to grab the text of : <span classname="narrative" ...
0
votes
2answers
37 views

Trying to extract data using python/scrapy and not able to find the correct xpath

I wanted to scrape the website. https://megam.info/jobs?med=site-ui&ref=jobs-tab I want to extract Title Location Company of the job postings. I tried few xpath's for the location,...
2
votes
3answers
58 views

Selenium can not scrape Shopee e-commerce site using python

I am not able to pull the price of products on Shopee (a e-commercial site). I have taken a look at the problem solved by @dmitrybelyakov (link: Scraping AJAX e-commerce site using python) . That ...
0
votes
0answers
32 views

Locating ad element on a page using xpath - selenium on node

I am trying to locate ad elements on a page using xpath on selenium (using selenium with nodejs). What i am trying to do right now is find all hrefs which contain "doubleclick". I am doing it as ...
1
vote
2answers
22 views

xpath for price with currency

<category> <Movi Name="Test"> <Price>$3.95</Price> </Movi> <Movi Name="test d"> <Price>$13.95</Price> </Movi> </...
-1
votes
0answers
26 views

How to handle StaleElementReferenceException including error executing JavaScript [duplicate]

while running the code, no problem occurs for the first selectobject. I'm getting the error for second selectobject. For the first one, I'm selecting a brandtype in combobox and doing the same thing ...
0
votes
1answer
37 views

Unable to locate element using ID or Name

HTML: <input name="txtAnswer" type="text" maxlength="20" id="txtAnswer" class="box1"> Code trials: driver.findElement(By.xpath("//table[@id='tblSecurityAnswer']//tbody//tr[2]//td[2]//input[@...
-1
votes
0answers
31 views

My items have a “ghost item” in them after every 10 items in my CVS

I am creating a facebook reactions spider to save profiles and reaction types as items in a cvs, however with every new item list (whenever my crawler is about to load the next 10 reactions of the ...
0
votes
1answer
52 views

Including text with <strong> and <em> tags when scraping html using lxml & requests?

I'm scraping text from a webpage using lxml and requests. All of the text that I want is under <p> tags. When I use contents = tree.xpath('//*[@id="storytext"]/p/text()'), contents only includes ...
0
votes
2answers
18 views

html scrape using requests and lxml produces <Element x at location> instead of the text located at that node

I'm creating a Python program, using lxml and requests to scrape text from a website. However, when I navigate to the correct node, my code produces an element label instead of the text that's located ...
0
votes
1answer
20 views

How can I get a top element like a preceding of an element on xpath?

I need to get the father node of an element but specifying some attributes of then, not using indexes My scenario is this <div class="flockToUnlock section"> <flock-to-unlock> ...
-2
votes
1answer
34 views

How to write xpath for tag named onclick within selenium

I'm trying to click a tab which is clickable on application menu but once i try to capture that web element through xpath it's not working and getting "unable to find element" error. HTML expression ...
0
votes
1answer
30 views

How to locate element to click in a website

I need to fill a form. I am beginning to use Selenium. After logging in with no issues the new screen is coming. There there is a tab on the left side that I need to click in order to open the form ...
0
votes
0answers
23 views

Click on element with span in robot framework RIDE [duplicate]

I need to click on following element in robot framework RIDE: <span role="img" id="button-1038-btnIconEl" class="x-btn-icon-el " unselectable="on" style="background-image:url(custom/k/css/images/...
0
votes
1answer
29 views

Select duplicate tag id in XPath

How do I get the duplicate tag id using Xpath. For eg: <Employees> <Employee id="1"> <age>29</age> <name>Pankaj</name> <gender>...
0
votes
2answers
30 views

XPath to select node text based on node text in same node [duplicate]

I am attempting to find the value in an xml file based on searching with xpath to locate the node. The problem I am running into is that the ID for the node I am concerned about and the value I am ...
-1
votes
1answer
14 views

XPath to retrieve name of node within a choice in the Schema

I have an xml schema with a complex element containing a choice node: <xs:complexType name="MemberType"> <xs:sequence> <xs:element name="FirstName" type="xs:string"/>...
0
votes
1answer
33 views

How to Find Element Text within <span> using Selenium?

I am pretty new to Python and Selenium, and I have got my script to do what I want so far, but I have this current coding from the website: <a onclick="realPostBack('ctl00$ctl00$mainContent$...
1
vote
2answers
31 views

Xpath tokenize function inside contains function

I would like to know how to use nested string functions in a XPath query. For instance my XML is like below. <Invoice> <cbc:Note>Fatura Tipi:MM Alınan Mlz.İade</cbc:Note> </...
-1
votes
0answers
10 views

How to select a paragraph all content plain and formatted text using Xpath

Using this line i'm trying to access all the text that is under the paragraph (simple and fromatted). response.xpath('.//div[@class="pgContent"]/p/text()').getall()
0
votes
0answers
52 views

document.evaluate JavaScript returns nothing in AppleScript

I’m writing an AppleScript script to scrape a webpage in Safari, and there is a piece that I’ve been struggling with for quite a bit now. This returns the required text: log (do JavaScript "document....
0
votes
0answers
36 views

Is it possible to combine the result of a query with an edit?

Suppose I got this xml file: <xml> <Attribute name="attribute1"> <Value1>True</Value1> <Value2>True</Value2> ...
0
votes
0answers
26 views

How to access list of text of child node of li element using selenium in c#

Having issues accessing the child node of a li element. Looking to print out all text within a list (which acts as a dropdown on the webpage). But all of the text is within an li element under an a> (...
0
votes
0answers
17 views

How to rename div css class name in html page parsing via Xpath PHP [duplicate]

I have parsed a part of html page using Xpath query. I saved it as html, however I want to replace the original with my own css class - $dom = new DOMDocument(); $dom->loadHTML($html); $xpath = ...
2
votes
2answers
35 views

Partial matching using Xpath

I'm trying to create a search function allowing partial matching by song title or genre using Xpath. This is my XML file: <?xml version="1.0" encoding="UTF-8"?> <playlist> <item> ...
0
votes
1answer
17 views

How to fix xpath function min() “as an invalid token” in BizTalk shape?

I have an Xpath code in a BizTalk Expression shape which is return this error : 'min(/[local-name()='EmployeeUDM_Response' and namespace-uri()='http://Securitas/ESB/Schemas/v2/EmployeeUDM']/[local-...
-1
votes
0answers
22 views

Stumped on getting proper Xpath after </html>

I have an issue where there is code after the end html brackets and I cannot seem to refer to it with xpath in Selenium web driver through RPA Express. Basically the HTML and DIV are on the same level,...
0
votes
1answer
30 views

How stop on specific tag?

How get whole text under h1 tag to the next h1 tag? I have class name of starting h1 tag ... <h1 class="something">...</h1> ... <h1 ...>...</h1> ... I tried: //*[@class='...
-1
votes
1answer
41 views

Is there a way to get url present of an element who's value is < a href = “#”>

I am trying to scrape data the website Bestbuy.com (USA),when we go to the product page URL for the first time It asks us to choose the country, product page. I am trying to get the URL of the page ...
-1
votes
0answers
54 views

How to get a date using Substring and C#?

I have small problem - how to get a "Yesterday 11:20" using Substring ? <div class="box-title-description" style="--darkreader-inline-outline:#cc0000;"> <a class="text-muted" href="/ttests/...
1
vote
3answers
76 views

How to select element generated from JavaScript?

I am trying to select the Wireless button on the pop-up that is generated in the same window. It does not generate any iFrames and I cannot locate any elements inside this Wifi-Connect window. Anyone ...
2
votes
1answer
31 views

XPath: if child exists - get value, if not - write empty line

I have three node types: without categories, with a single category and multiple categories: <technology> <categories> <category></category> </categories> <...
0
votes
1answer
36 views

Selenium: Unable to click a button of custom popup

I tried to click a button of select files then submit button in the popup but it neither recognizes the popup nor the button in it. For selecting the modal-content driver.switchTo().frame("modal-...
0
votes
0answers
23 views

Cannot find element by xpath using selenium-webdriver [duplicate]

I encouter a issue while trying to get some elements by xpath using selenium in python. I work on webpages similar to this one : https://warframe.market/items/mirage_prime_set I'm trying to get the ...
1
vote
0answers
49 views

How to invoke “dynamic” XPaths with count() in Karate?

I'm trying to invoke a "dynamic" XPath in Karate that uses the XPath count() function to return a number (or string representation). [With Karate 0.9.2] I'm trying to invoke "dynamic" XPath ...
0
votes
4answers
64 views

Selecting an item from the dropdown menu of a list using Python + Selenium

I'm trying to select an element from an unordered list using Selenium in Python. My current code clicks on the drop down menu and opens it up, but I'm having trouble getting it to click on an item in ...
1
vote
1answer
37 views

Why do I get “N/A” when using xpath in Google sheets-importxml, but not in Chrome HTML debugger?

I'm working on a webscraping project on the following website http://www.comune.taranto.it/index.php/avvisi. I would like to extract the content of the first table and insert them into a Google ...
0
votes
2answers
19 views

Relative XPath Help for HTML Tag

I'm trying to create a relative XPath selector statement for this tag below: <a class="bttn bttn--primary bttn--inline js-localizeButton" ><span class="bttn__content">Click Me</span&...