如何使用javascript或python允许chrome中的所有第三方?

问题描述

是否可以使用javascript或python进行以下操作?

在网址框中输入此内容Usuario.findOne

在 cookie 和其他站点数据中 -> 常规设置 -> 允许所有 cookie

解决方法

Ypu can do something like this. Just need to find out exact xapth element.
from selenium import webdriver
import time
driver = webdriver.Chrome(executable_path='C:\\temp\\chromedriver.exe')
driver.get('chrome://settings/cookies')
time.sleep(3)
driver.find_element_by_xpath("<xpath locator>").click()