首页 > 解决方案 > 需要绕过云耀斑安全

问题描述

从过去几天开始,我试图抓取一个网站,但无法这样做。由于其 cloudflare 安全性“检查您的浏览器”。

我已经在 python 中使用 selenium 进行了尝试,请求但无法实现网站的主要内容。

有什么方法/方法可以让我们抓取使用 cloudflare 安全的网站吗?

请让我知道。谢谢这里是我要抓取的链接

标签: pythonseleniumselenium-webdriverbeautifulsoupcloudflare

解决方案


我明白了,如果你尝试:

requests.get('https://www.example.com')

你得到:

Please enable cookies.

所以你可以使用 cloudflare-scrape 模块(python -m pip install cfscrape)

import cfscrape
scraper  =  cfscrape.create_scraper()
scraper.get('example.com')

推荐阅读