无法在ahrefs.com使用其免费DR服务绕过Cloudflare验证码(使用“seleniumbase”)

0 投票
1 回答
143 浏览
提问于 2025-04-14 17:27

这是我的代码:(我正在使用 seleniumbase 来访问这个网站)

from seleniumbase import SB, Driver
import time 

with SB(uc=True, test=True) as sb:
    url = "https://ahrefs.com/website-authority-checker"
    sb.driver.uc_open_with_reconnect(url, 3)
    sb.type('/html/body/div/div[1]/section[1]/div/div/div/div/div/div[2]/div[2]/div[2]/form/div/div/div[1]/div/input', 'https://www.peopleperhour.com')
    time.sleep(2)
    sb.click('/html/body/div/div[1]/section[1]/div/div/div/div/div/div[2]/div[2]/div[2]/form/div/button')
    time.sleep(10)
    sb.post_message("SeleniumBase wasn't detected", duration=4)

验证码让我验证,但一直在继续

我想获取一些与网站强度相关的统计数据(比如域名评分、反向链接、链接网站),但是一个Cloudflare的验证码挡住了我的路,尽管我在使用seleniumbase。这里有一个视频链接,我是在那里学到关于seleniumbase的知识的: https://www.youtube.com/watch?v=5dMFI3e85ig

1 个回答

0

这里有一个完整的 SeleniumBase 脚本,可以在那个页面上运行:

from seleniumbase import SB


with SB(uc=True, test=True, locale_code="en") as sb:
    url = "https://ahrefs.com/website-authority-checker"
    sb.driver.uc_open_with_reconnect(url, 4)
    sb.type('input[placeholder="Enter domain"]', "https://www.peopleperhour.com")
    sb.driver.uc_click('span:contains("Check Authority")', reconnect_time=4)

    breakpoint()

breakpoint() 的地方,输入 c 然后按 Enter 键继续。

在这里输入图片描述

撰写回答