Currently, I’m working on coding a webscraper of sorts; I want to change pages and still be able to detect what I’m looking for in terms of certain qualities.
Right now I’m using:
mouse_tracker = browser.find_element(By.XPATH, "//*[span[contains(text(), 'PDF')]]")
But it’s unable to select any but the first of the links that fit the qualities. What I’m looking for is being able to select any link that has those qualities (but only one at a time). For example, if I switch pages or scroll down a page to get a deeper amount of results, it’ll be able to select one of those links with the same qualities instead of being fixated on the first link it sees.
1
Find elements as browsenator said:
mouse_tracker = browser.find_elements(By.XPATH, "//*[span[contains(text(), 'PDF')]]")