【发布时间】:2018-10-01 20:57:02
【问题描述】:
我正在使用 Selenium、Python 抓取页面。打开页面时会出现一个弹出窗口。无论如何我想关闭这个弹出窗口。我尝试如下:
url = https://shopping.rochebros.com/shop/categories/37
browser = webdriver.Chrome(executable_path=chromedriver, options=options)
browser.get(url)
browser.find_element_by_xpath("//button[@class='click' and @id='shopping-selector-parent-process-modal-close-click']").click()
我在这里尝试了几个类似的帖子,但没有任何东西适合我。在错误之下,我得到了。
Message: no such element: Unable to locate element: {"method":"xpath","selector":"//button[@class='click' and @id='shopping-selector-parent-process-modal-close-click']"}
【问题讨论】:
标签: python selenium selenium-webdriver webdriver webdriverwait