Unable to add a cookie using Selenium & Splinter

后端 未结 2 1836
青春惊慌失措
青春惊慌失措 2021-01-07 04:30

Per below, I\'m not sure how to troubleshoot this pretty simple usage scenario.

I have script (that I run about once a month) that functionally does the identical th

2条回答
  •  盖世英雄少女心
    2021-01-07 04:42

    The answer of Florent B. works for me as well, just want to put it into the right place.

    browser.cookies.add needs to be called after some browser.visit(...)

    see Florent's comment:

    The method browser.cookies.add is bound to the current domain which is undefined in your example. You need to set the domain first with driver.get('http://...')

提交回复
热议问题