[英]how to run selenium code in regular chrome instead of chromedriver?
[英]how to run Selenium ChromeDriver with cookies from actual Chrome installation?
我想使用 Selenium(python) 登录多个站点,我需要获取我所有的 Chrome cookies,我应该怎么做?
无论如何,这是一个重复的问题:
请执行下列操作:
# Remember to import
from selenium.webdriver.chrome.options import Options
options = Options()
# Your user agent
options.add_argument("YOUR_USER_AGENT")
# Path to chrome application
options.add_argument("CHROME_APPLICATION_PATH")
# Path to chrome driver
driver = webdriver.Chrome(executable_path="CHROME_DRIVER_PATH", options=options)
您将需要对自己的系统进行一些研究,看看您的用户代理到底是什么(有一百万个网站告诉您)
以及为您的 chrome 应用程序找到正确的路径。
然后,正常进行,这将像您自己打开它一样执行 chrome。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.