目标链接位于几个
shadow-root块内。试试这个:
driver = webdriver.Chrome("chromedriver.exe")driver.get("chrome://downloads/")manager = driver.find_element_by_css_selector('body/deep/downloads-manager')item = manager.find_element_by_css_selector('body/deep/downloads-item')shadow = driver.execute_script('return arguments[0].shadowRoot;', item)link = shadow.find_element_by_css_selector('div#title-area>a')file_url = link.get_attribute("href")
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)