I'm using the find_element_by_partial_link_text
selector to find the "next" button, so that I can click it and continue crawling.
However, the issue I'm having is that sometimes the word "next" is also in other random links on the page, which breaks the script.
I've tried addressing this with the code below, which obviously doesn't work.
pagination_ul = ff.find_element_by_xpath('//*[contains(@id, "pagination-both-")]')
next_button = pagination_ul.find_element_by_partial_link_text('Next')
So my question is...
How can I retrieve and compare the parent element of a find_element_by_partial_link_text
element?
In other words, how can I make sure that the parent of the find_element_by_partial_link_text
is, say, a li
element?