Skip to main content

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.

8,670 questions with no upvoted or accepted answers
8 votes
1 answer
3k views

Make CSS Selector (first-child) work in Behat 3 with Sahi Driver

I was just wondering if you could point out where the problem is here, if it's Behat, the CSS selector, or the Sahi Driver. We have just upgraded to Behat 3 and are using Sahi Driver (most recent ...
sugarwaffle's user avatar
7 votes
0 answers
219 views

Is there a more concise way to implement css' An+B micro-syntax as xpath predicates?

I'm creating a CSS selectors to xpath 1 converter and one detail I struggled the most with is finding a concise substitute for the An+B micro-syntax. Since I'm implementing it for xpath 1 and in such ...
Decent Dabbler's user avatar
7 votes
2 answers
1k views

How to search elements matching an xpath expression in emacs nxml-mode?

Is there a way to interactively search for a nodes that matches a given xpath expression in emacs? I would like something similar to re-forward-search but instead of using a regular expression I'd ...
manu's user avatar
  • 3,763
6 votes
0 answers
2k views

How to set id in Jetpack Compose for Appium and UIAutomator (Xpath issue)

I am using Jetpack Compose and Appium with UIAutomator. I would like to set a unique id for the Composables instead of showing the Xpath because of: Using XPath locators is not recommended and can ...
Targetbus12's user avatar
6 votes
2 answers
7k views

XPath get text from multiple nodes

I need to create a StringArray with the nametext from: <xs:element name="xyz" type="xs:string/> <xs:element name="bla" type="xs:string/> ... How can I query the "xyz","bla" and more of ...
Lola Parola's user avatar
6 votes
1 answer
1k views

XPath query against DocumentFragment

I need to do some DOM surgery on a DocumentFragment, and I'm trying to use XPath to find the nodes that need to be modified. However, I can't figure out how to get document.evaluate to work on a ...
Yuri Sulyma's user avatar
5 votes
1 answer
927 views

Google Trends widget - Related queries - change view from Top to Rising via automatic click (ng-click)

Google Trends allows to embed widgets of search trends data on any HTML page. The widget "Related queries" presents data of Top and Rising search queries. By default when the embedded widget ...
Martinx's user avatar
  • 51
5 votes
1 answer
1k views

How to handle Angularjs / Javascript dropdown using Python / Selenium webdriver?

i want to automate some browser tasks using Python and Selenium webdriver on Chromium browser. My python script is already able to login, navigate to a subpage / do some clicks, and insert something ...
zimba's user avatar
  • 51
5 votes
3 answers
2k views

Click before a specific word within <p> tag using Selenium

We are using Selenium Webdriver for Test automation. Here is my requirement. HTML looks like this. <p> I need to click before this. Help me achieve this </p> The text within "p" tag can ...
Suzy's user avatar
  • 51
5 votes
0 answers
2k views

Selenium - Return Xpath of clicked element

I'm developing Selenium tests in java, and i'm looking for a solution for my problem. I want to click on a zone ( coordinates ) of an element during the test. This click implicitly returns me the ...
MxfrdA's user avatar
  • 171
5 votes
2 answers
2k views

PHP XML Memory Leak?

We have a severe memory leak in one of our regularly run scripts that quickly wipes out the free memory on the server. Despite many hours of research and experiments, though, I've been unable to even ...
Shane Pike's user avatar
5 votes
1 answer
971 views

How to retrieve innertext using capybara and poltergeist?

I have this simple HTML: <div> Test <span> someting </span></div> How can I retrieve only the innertext of the div? Using text retrieves all text from the div: [1] pry(#<...
egwspiti's user avatar
  • 967
5 votes
0 answers
912 views

cucumber capybara test highlighting text

Im using Cucumber with Capybara and Selenium, I'm trying to write test on a document reader that support functionality such as define and add note after text is highlight. My first thought is find the ...
user2840109's user avatar
5 votes
3 answers
1k views

Array to flat mapping in Mule based on condition

I am attempting to map a response from a 3rd party call into a different structure using the DataMapper transform within Mule. From the 3rd party we receive an array of items (amongst other things) ...
user2294382's user avatar
5 votes
3 answers
2k views

How to scrape images from eBay and Amazon using XPath in Nokogiri from JSON

I'm trying to scrape images from websites using Nokogiri and XPath, so far with limited success. For a typical website whose HTML has img and src, I can use: tmp2 = Nokogiri::HTML(open(site_url)) ...
purplerice's user avatar

15 30 50 per page
1
2 3 4 5
578