How to use default browser profile in Selenium instead of new one? [duplicate]

放肆的年华 提交于 2021-02-11 04:51:54

问题


I couldn't find any relevant answers and my question is pretty straight forward.

The context isn't really relevant.

It is very important for me that Selenium uses my normally installed browser (Chrome or Firefox), when doing coded things.


回答1:


Maybe using your standard profile helps? It did in my case where the website was detecting the Selenium browser. This code solved my problem.

path = str(Path.home())
path = path + "/.mozilla/firefox/xxxx.default-release"
profile = FirefoxProfile(path)
driver = webdriver.Firefox(profile)


来源:https://stackoverflow.com/questions/58273428/how-to-use-default-browser-profile-in-selenium-instead-of-new-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!