I'm scraping this page:
and need to press the button to see the reviews.
with chrome I get this path
//*[@id="myspanpos"]
But when I try the scrip:
NEXT_BUTTON_XPATH = '//*[@id="myspanpos"]'
button = browser.find_element_by_xpath(NEXT_BUTTON_XPATH)
button.click()
got:
Unable to locate element: {"method":"xpath","selector":"//button[text()=\"myspanpos\"]"}
To open "Reviews" drop-down window you need to click on anchor tag element (<a>
), not on <span>
. So use
browser.find_element_by_id('close_open').click()