if href.startswith("https://store.steampowered"):
browser.get(href)
if browser.current_url.startswith("https://store.steampowered.com/agecheck"):
area = browser.find_element_by_id("agecheck_form")
location_field = area.find_element_by_id("ageYear")
for option in location_field.find_elements_by_tag_name("option"):
if int(option.text) == 1999:
option.click()
break
enter = browser.find_element_by_xpath('//*[@id="agecheck_form"]/a')
enter.location_once_scrolled_into_view.click()
我对这段代码的意图是去一个steam游戏页面来获取游戏的价格。如果它遇到年龄检查墙,它会运行我上面的代码。在
https://store.steampowered.com/agecheck/app/489830/
我的问题是无论我如何格式化enter按钮上的click事件,它都会给我错误:“dict”对象没有属性“click”
我已经查过字典是什么,但还是找不到答案。 我怀疑这个问题可能与我的选项循环有关。在
location_once_scrolled_into_view
返回字典、x
和{webelement
。在相关问题 更多 >
编程相关推荐