0

I am trying to send a few POST/GET requests then transfer the session/cookies to a Chrome webdriver with Selenium. As I am new to Selenium, I'm unsure of how to accomplish this. I have seen how people do Selenium session to requests, but that's not what I need. Any help would be appreciated as I have looked everywhere and can't see to find a solution.

import requests
from selenium import webdriver

driver = webdriver.Chrome()
s = requests.Session()
s.post('http://example.com')
s.get('http://example.com')

# need to trasnfer session/cookies to driver
driver.get('http://example.com')
Helixo
  • 29
  • 1
  • 5
  • 1
    Possible duplicate of [Python - Requests, Selenium - passing cookies while logging in](https://stackoverflow.com/questions/42087985/python-requests-selenium-passing-cookies-while-logging-in) – Andersson Nov 19 '17 at 10:23
  • use the get and add cookie method http://selenium-python.readthedocs.io/navigating.html#cookies **duplicate** https://stackoverflow.com/questions/15058462/how-to-save-and-load-cookies-using-python-selenium-webdriver – mtt2p Nov 20 '17 at 22:54

0 Answers0