https://stackoverflow.com/questions/41559510/selenium-chromedriver-add-cookie-invalid-domain-error The solution is: First visit the home page of the website whose cookies you are trying to add. # first visit home page url = "https://www.website.com" driver.get(url) # add