0

My program uses a proxy and works with several services where I need to load cookies. Using a proxy, loading a website can take a lot of time anyway, but this way takes even more:

driver.get('url')
for cookie in pickle.load(open("path", "rb")):
    driver.add_cookie(cookie)
driver.refresh()

Also, this method can sometimes cause the service to be suspicious, because first it receives a request without a cookie and then with a cookie. After that, captchas may appear and etc. How can I load cookies before loading page?

  • Does SO thread [how-to-set-a-cookie-to-a-specific-domain-in-selenium-webdriver-with-python](https://stackoverflow.com/questions/24919525/how-to-set-a-cookie-to-a-specific-domain-in-selenium-webdriver-with-python) help? – Heelara Jan 09 '23 at 01:27
  • Does this answer your question? [How to set a cookie to a specific domain in selenium webdriver with python?](https://stackoverflow.com/questions/24919525/how-to-set-a-cookie-to-a-specific-domain-in-selenium-webdriver-with-python) – Frederickcjo Jan 10 '23 at 07:58

0 Answers0