Closed asibhossen897 closed 1 month ago
This was all that was needed to bypass the CAPTCHA:
from seleniumbase import SB
with SB(uc=True,) as sb:
sb.driver.uc_open_with_reconnect(
"https://visa.vfsglobal.com/are/en/pol/login",
reconnect_time=12
)
As seen here: https://stackoverflow.com/a/77578982/7058266
Don't maximize the window in UC Mode. Only use uc_click
when clicking anything on a page that tries to detect Selenium. Make sure the reconnect_time
is long enough to bypass detection. On that website, the CAPTCHA can be bypassing without clicking inside the iframe, which means that if you still have to click it, it means that they already detected you.
In the first page, yes, it can be passed without clicking. But I forgot to mention that the problem occurs in the second page, where we need to input the OTP. And if they've detected me, then what can I do? Any tips? (I've also tried using proxies)
Also, the SB class can not bypass the CAPTCHA in my mentioned URL https://visa.vfsglobal.com/ind/en/pol/login
. When I try with the Driver class, the first page's CAPTCHA is bypassed without clicking.
from seleniumbase import SB
import time
# Reading the credentials
with open('creds.txt', 'r') as f:
lines = f.read().splitlines()
mail = lines[0].strip()
password = lines[1].strip()
with SB(uc=True,) as sb:
sb.driver.uc_open_with_reconnect(
"https://visa.vfsglobal.com/ind/en/pol/login",
reconnect_time=20
)
sb.press_keys("#mat-input-0", mail)
sb.press_keys("#mat-input-1", password)
time.sleep(2)
sb.highlight_click(".mat-button-wrapper")
time.sleep(20)
Not sure what you're seeing, because I don't have a full screenshot of where your script got stuck, but for maximum stealth, combine UC Mode with pyautogui
and perform actions while disconnected. You can do driver.disconnect()
to disconnect the driver. Then perform the pyautogui
actions. Then driver.connect()
afterwards so that you can perform Selenium actions again.
Ok, thanks. I'll try this. What screenshot I need to provide here? If you don't mind me asking.
You said that the problem occurs on the second page, where you need to input the OTP. A screenshot might help, since I won't be able to see that page without having an account.
UC Mode should still work if used properly. If not, use pyautogui
.
Solved the CAPTCHA problem with manual login. Having some trouble with pyautogui
to click on the Sign In button. It can't find the Button from screenshot.
Anyway, thank you very much for helping out.
love for your work @mdmintz
I'm using Driver class to automate login process on a website and even I'm using the uc mode, it does not seem to work properly. I've also tried with other classes, the result is the same. When the span of the iframe is clicked, it shows Failure. I've also tried manual clicking, it's the same. Here is the code
Here is the screenshot