【发布时间】:2021-12-09 09:24:54
【问题描述】:
我需要在https://garantex.io/ 上按下绿色按钮以接受 cookie 我的代码:
driver = webdriver.Chrome(ChromeDriverManager().install())
driver.implicitly_wait(10)
driver.get("https://garantex.io/")
try:
cookie_access = driver.find_element_by_class_name('btn.btn-success')
print("Is displayed = " + str(cookie_access.is_displayed()))
except Exception as e:
driver.close()
print(e)
我有Is displayed = FALSE。如何与此按钮交互?
【问题讨论】:
-
我试图让 webdriver 等待
excepted_conditions的可见性,但即使在等待 30 秒后我也有Timeout Exception。 -
请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。
-
我需要使用 selenium webdriver 与按钮交互,但 webdriver 不显示此按钮。我必须做些什么来解决这个问题?
标签: python html selenium dom button