如何使用python点击selenium中动态变化的链接

这是 html 文件:

问题是 href 上的日期每周都在变化。


holdtom
浏览 58回答 1
1回答

慕码人8056858

引起一些等待并使用 css 选择器。WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a.link-lg.pull-right.flip.ng-scope"))).click()进口from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait  from selenium.webdriver.support import expected_conditions as EC
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python