1

My Aim

I've passed my actual profile into ChromeOptions(), so that I can retrieve my actual cookies from my normal Chrome App, I then want to pass these cookies into a new Chrome browser, (as this browser wont be able to use the profile ChromeOptions), so that I can access a certain website using those cookies.

Here's what I tried:

options = webdriver.ChromeOptions()
options.add_argument("C:\\Users\\coderofftheday\\AppData\\Local\\Google\\Chrome\\User Data\\Default")

browser = webdriver.Chrome('chromedriver.exe',options=options)
browser.get('https://www.google.co.uk/')
time.sleep(10)
pprint.pprint(browser.get_cookies())

Unfortunately No cookies for any sites apart from google were printed.

coderoftheday
  • 1,987
  • 4
  • 7
  • 21
  • 1
    did you mean apart from Nike? You should only be able to see Nike's cookies and any that aren't restricted to samesite. (and I don't think Nike's site would have ads...) – pcalkins Sep 25 '20 at 19:17
  • sorry i was meant to put the google url inside there – coderoftheday Sep 25 '20 at 19:18
  • 1
    Sounds like google does not use cookies to remember your google account login information. They may set a session cookie once you login, but I have a feeling they are logging you in when you launch the browser. (They kind of have to to present that little avatar in the upper-right.) So I guess the question really is how to login to your Google account using Selenium. (Not sure there is a way...even if you type in name/password since google can and does detect bots.) – pcalkins Sep 25 '20 at 19:29
  • 1
    maybe check this thread: https://stackoverflow.com/questions/60117232/selenium-google-login-block – pcalkins Sep 25 '20 at 19:34
  • @pcalkins yeah i cant see the avatar, and its not logging in, I think that's the reason why – coderoftheday Sep 25 '20 at 19:58

0 Answers0