Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

issue when run code in RDP or VPS while bypassing cloudflare #3334

Akshay-Shingala started this conversation in General
Discussion options

i have issue when i try to run simple code that, for example
`from seleniumbase import SB

with SB(uc=True, test=True, incognito=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.uc_open_with_reconnect(url) # The bot-check is later
sb.type(input_field, "github.com/seleniumbase/SeleniumBase")
sb.reconnect(0.1)
sb.uc_click(submit_button, reconnect_time=4)
sb.uc_gui_click_captcha()
sb.wait_for_text_not_visible("Checking", timeout=12)
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!")
`
In RDP or VPS, it is not able to bypass cloudflare, and when I run the same code in local, it will work properly.

I am not able to find what the issue is. Can anyone guide me to find the issue?

I run this code savral time in my local system, and it will work fine but not in VPS.

also same like if i run
`
from seleniumbase import Driver

driver = Driver(uc=True)
url = "https://gitlab.com/users/sign_in"
driver.uc_open_with_reconnect(url, 4)
driver.uc_gui_click_captcha()
driver.quit()
`
in local system without uc_gui_click_captcha, it is able to bypass, but in VPS it is not working.

You must be logged in to vote

Replies: 1 comment 4 replies

Comment options

i have issue when i try to run simple code that, for example `from seleniumbase import SB

with SB(uc=True, test=True, incognito=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.uc_open_with_reconnect(url) # The bot-check is later sb.type(input_field, "github.com/seleniumbase/SeleniumBase") sb.reconnect(0.1) sb.uc_click(submit_button, reconnect_time=4) sb.uc_gui_click_captcha() sb.wait_for_text_not_visible("Checking", timeout=12) 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!") ` In RDP or VPS, it is not able to bypass cloudflare, and when I run the same code in local, it will work properly.

I am not able to find what the issue is. Can anyone guide me to find the issue?

I run this code savral time in my local system, and it will work fine but not in VPS.

also same like if i run ` from seleniumbase import Driver

driver = Driver(uc=True) url = "https://gitlab.com/users/sign_in" driver.uc_open_with_reconnect(url, 4) driver.uc_gui_click_captcha() driver.quit() ` in local system without uc_gui_click_captcha, it is able to bypass, but in VPS it is not working.

update

pip3 install seleniumbase -U

from seleniumbase import SB
with SB(uc=True, test=True, locale_code="en") as sb:
 url = "https://gitlab.com/users/sign_in"
 sb.activate_cdp_mode(url)
 sb.uc_gui_click_captcha()
 sb.assert_text("Username", '[for="user_login"]', timeout=3)
 sb.assert_element('label[for="user_login"]')
 sb.highlight('button:contains("Sign in")')
 sb.highlight('h1:contains("GitLab.com")')
 sb.post_message("SeleniumBase wasn't detected", duration=4)

use cdp and for vps you have to use xvfb

You must be logged in to vote
4 replies
Comment options

so whit out uc_gui_click_captcha i can't solve it right ?

Comment options

thank you for help
Also, I have more questions. There is a website where I have to bypass Cloudflare two times: the first time when I load the website and the second time when I click on some button, then also one Cloudflare CAPTCHA opens, but I am not able to bypass both if I am using uc_gui_click_captcha to solve the first captcha I am not able to solve it a second time.

Comment options

thank you for help Also, I have more questions. There is a website where I have to bypass Cloudflare two times: the first time when I load the website and the second time when I click on some button, then also one Cloudflare CAPTCHA opens, but I am not able to bypass both if I am using uc_gui_click_captcha to solve the first captcha I am not able to solve it a second time.

share your code.

Comment options

from seleniumbase import SB
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
fire = '/html/body/div[1]/div/main/div/div/div[1]/div/div[1]/div[4]/div/div[3]/button[4]'
# with SB(uc=True, test=True, ad_block=True) as sb:
with SB(uc=True, test=True,proxy="",guest=True,uc_sub=True,uc_subprocess=True,) as sb:
 url = ""
 sb.activate_cdp_mode(url)
 sb.uc_gui_click_captcha()
 time.sleep(5)
 sb.uc_click("button.custom-pr2mrc", reconnect_time=15,timeout=15)
 sb.uc_gui_handle_captcha(frame="iframe")
 sb.uc_gui_click_captcha()
 
 sb.uc_click("button.custom-pr2mrc", reconnect_time=15)
 sb.uc_gui_handle_cf(frame="iframe")
 

in VPS i am using proxy. using sb.uc_gui_click_captcha() it can bypass first page but when it try to click on button
image

This Cloudflare checkbox appears, and I am not able to bypass it. If I run code locally(windows 11), it can bypass both checkboxes, but in VPS(windows 11), it creates an issue. Also, on the page, there are more than one iframe. Did this create an issue for solving the checkbox?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /