首页 > 解决方案 > 无法使用 chrome 在 Python Selenium 上加载我的个人资料

问题描述

我正在尝试通过 google chrome 抓取数据,为了避免一些验证码抓取网站,我必须使用我的帐户登录(用户名和密码保存在 chrome 上)。

ua = UserAgent()
a = ua.random
user_agent = ua.random
print(user_agent)
options = webdriver.ChromeOptions()
options.add_argument(f'user-agent={user_agent}')
options.add_argument("user-data-dir=C:\\Users\30693\\AppData\\Local\\Google\\Chrome\\User Data")
driver = webdriver.Chrome(executable_path=r'C:\Windows\chromedriver.exe', options=options)

driver.get("https://www.spitogatos.gr/pwliseis-katoikies/athina-notia-proastia/")

https://imgur.com/gallery/vUaWtKG

我做错了什么?

先感谢您

标签: pythonselenium

解决方案


推荐阅读