from selenium import webdriver
from msedge.selenium_tools import EdgeOptions
from msedge.selenium_tools import Edge
edge_options = EdgeOptions()
edge_options.use_chromium = True
# 设置无界面模式,也可以添加其它设置
edge_options.add_argument('headless')
#规避被检测到的风险
edge_options.add_experimental_option("excludeSwitches", ["enable-automation"])
driver = Edge(options=edge_options)
r = driver.get('https://www.baidu.com')
print(driver.page_source)
driver.quit()
爬虫selenium+edge屋头浏览器+规避检测风险
最新推荐文章于 2023-10-17 15:45:52 发布