1

我想像这样使用 python selenium 更改我正在访问的站点之外的 cookie(这是我的 chrome 选项卡而不是 selenium 浏览器)

曲奇饼

我输入的站点:https ://2captcha.com/tr/demo/hcaptcha?difficulty=difficult 我从框架中使用的 Cookie 站点:newassets.hcaptcha.com

起初我试图做类似的事情:

import time

from selenium import webdriver


driver = webdriver.Chrome()
driver.get('https://newassets.hcaptcha.com')
cookie = {"name":"hc_accessibility","value":""}
driver.add_cookie(cookie)
driver.refresh()
time.sleep(2)
driver.get("https://2captcha.com/tr/demo/hcaptcha?difficulty=difficult")
time.sleep(2)

但是当我进入该站点时,hcaptcha_accecibilty cookie 不存在(这是我的 selenium 浏览器选项卡) 饼干2

4

0 回答 0