网页抓取,如何在 Edge 上使 Internet Explorer 兼容

web scraping, how to make internet explorer compatibility on Edge

提问人:VitorMendes 提问时间:11/17/2023 最后编辑:John GordonVitorMendes 更新时间:11/17/2023 访问量:19

问:

我正在 Phyton 中开发网页抓取,但我需要输入信息的网站只能在 Internet Explorer 中使用,而且它非常旧。

我可以在 Edge 上兼容地运行网站,但我无法让程序在 Internet Explorer 模式下运行 Edge 以打开网站,谁能帮我?

我试试这个

from selenium import webdriver

ieOptions = webdriver.IeOptions()
ieOptions.add_additional_option("ie.edgechromium", True)
ieOptions.add_additional_option("ie.edgepath",'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe')
driver = webdriver.Ie(executable_path='E:\webdriver\IEDriverServer.exe', options=ieOptions)

driver.maximize_window()
driver.get('https://www.google.com/')
python selenium-webdriver web-scraping web

评论


答: 暂无答案