【发布时间】:2021-06-05 21:04:52
【问题描述】:
我正在尝试网页抓取,我需要模拟点击按钮,我已经尝试过:
url = "https://apps5.mineco.gob.pe/transparencia/mensual/default.aspx?y=2021&ap=ActProy"
driver = driver = webdriver.Chrome()
driver.get(url)
nivelGob = driver.find_element_by_xpath('//*[@id="ctl00_CPH1_BtnTipoGobierno"]')
nivelGob.click()
并返回此错误:
selenium.common.exceptions.NoSuchElementException:消息:没有这样的元素:无法找到元素:{"method":"xpath","selector":"//*[@id="ctl00_CPH1_BtnTipoGobierno"]"} (会话信息:chrome=88.0.4324.190)
我一直在尝试通过 css 选择器、类名来查找元素,但什么也没有。
这是按钮:
我希望有人可以帮助我。非常感谢。
【问题讨论】: