【发布时间】:2021-08-05 21:21:43
【问题描述】:
我只是想绕过使用 selenium python 的 cloudfare 服务我已经编写了代码但它不起作用
这是我的代码:
import selenium
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
options.add_argument("--disable-blink-features")
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
options.add_argument("--disable-blink-features=AutomationControlled")
driver = webdriver.Chrome(options=options, executable_path=r".\chromedriver.exe")
driver.maximize_window()
driver.get('https://poocoin.app/tokens/0xef2ec90e0b8d4cdfdb090989ea1bc663f0d680bf')
当我运行代码时,我会卡在 cloudfare 中
查看截图:
【问题讨论】:
-
“但它不起作用”是什么意思?即使我手动打开该链接,您看到的屏幕也会显示。
-
当我手动打开它会完美打开
-
嗨,我已经更新了问题,请检查一下希望你明白我想说什么
标签: python selenium selenium-webdriver web-scraping selenium-chromedriver