From 5bd9f749904f9ed55daf03c9a18545d3f8436be3 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Fri, 8 Mar 2024 14:04:32 -0500 Subject: [PATCH] Add another example of bypassing a CAPTCHA --- examples/raw_ahrefs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 examples/raw_ahrefs.py diff --git a/examples/raw_ahrefs.py b/examples/raw_ahrefs.py new file mode 100644 index 00000000..e3460528 --- /dev/null +++ b/examples/raw_ahrefs.py @@ -0,0 +1,16 @@ +from seleniumbase import SB + + +with SB(uc=True, test=True, locale_code="en") as sb: + url = "https://ahrefs.com/website-authority-checker" + input_field = 'input[placeholder="Enter domain"]' + submit_button = 'span:contains("Check Authority")' + sb.driver.uc_open_with_reconnect(url, 1) # The bot-check is later + sb.type(input_field, "github.com/seleniumbase/SeleniumBase") + sb.driver.reconnect(0.1) + sb.driver.uc_click(submit_button, reconnect_time=4) + sb.wait_for_text_not_visible("Checking", timeout=10) + sb.highlight('p:contains("github.com/seleniumbase/SeleniumBase")') + sb.highlight('a:contains("Top 100 backlinks")') + sb.set_messenger_theme(location="bottom_center") + sb.post_message("SeleniumBase wasn't detected!")