//div[contains(@class,"td-01")]
使用selenium的必要插件
必须下载,然后配置环境变量
driver.find_element_by_css_selector("[type=submit]").click()
driver.find_elements_by_css_selector(".btn.btn-outline-secondary")[1].click()
# 防止被监测,完美隐藏window.navigator.webdriver
driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
"source": '''
Object.defineProperty(navigator, 'webdriver', {
get: () => undefined
})
'''
})
options = webdriver.ChromeOptions()
options.add_argument("--headless") # 设置谷歌为headless无界面模式
driver = webdriver.Chrome(options=options)
命令行执行程序
item = os.popen('ipconfig')
item = item.read()
for i, title in enumerate(title_info):