webdriver cookies transfer to request session

firstly, get cookie:

browser.get_cookies()

then transfer to requests session:

 cookies = login()

    for cookie in cookies:

        session.cookies.set(cookie['name'], cookie['value'])

posted @ 2022-04-06 10:50  CrossPython  阅读(22)  评论(0编辑  收藏  举报