java - xpath how to get quantity of links on page? -


For example, I'm searching for something in Google, instead I get search results, and I'm using xpath or any other locator Need is the essence of all the links on the results page? Any suggestions?

If I was doing this for a google search, then first let me link one. You can select a code in Chrome and inspect the element , then right-click on the newly selected element, and then copy the APAP Example:

choose xpath

I get // * However, by clicking on it [@ id = "rso"] / div [1] / li [1] / div / h3 / a it is only li [1] and Because of the div [1] will select a single element, which limits the query, you may have to write XPath to // * [[id = "rso"] / div / li / Div / h3 / a , which selects all 10 search results.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -