Skip to content

Instantly share code, notes, and snippets.

@ayuLiao
Created July 15, 2019 07:51
Show Gist options
  • Save ayuLiao/de35b6c6bbc9d80ded61d27985954c9c to your computer and use it in GitHub Desktop.
Save ayuLiao/de35b6c6bbc9d80ded61d27985954c9c to your computer and use it in GitHub Desktop.
必须首先加载网站这样 Selenium 才能知道 cookie 属于哪个网站
不然会报selenium.common.exceptions.WebDriverException: Message: unable to set cookie
chrome.get("https://www.baidu.com/")
chrome.add_cookie(cookie_dict)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment