Open SaberTawfiq opened 8 months ago
Hey boss, can u book appointment dates?
Hey boss, can u book appointment dates?
yep but can't solve gcaptcha or mandatory field error
Can I have your WhatsApp number?
I guess it's the site's error, but can't even fill it manually it always shows up like that
You should send a pull request with the changes you made so that they can look further into the issues.
get error message when try to login https://visa.vfsglobal.com/gbr/en/mlt/login after add email and password going to solve the g-captcha after solve and be true click on sign in button get this error "Mandatory field cannot be left empty" how to fix that https://www.mediafire.com/file/42uup2lpml1j9v2/Before__Connexion_VFS_Global.html/file https://www.mediafire.com/file/j33azoraavxxwrw/After_Connexion_VFS_Global.html/file
Function to handle Google Captcha
def Captcha(sb, excel_file_path):
Check for Google Captcha element
def wait_recaptcha_to_be_solved(sb, excel_file_path): try: sb.is_element_present('iframe[title="reCAPTCHA"]') except: current_time = datetime.now().strftime("%I:%M:%S %p") print(colorama.Fore.BLACK + f"{current_time} - ERROR: WE CANNOT SWITCH TO RECAPTCHA IFRAME") else: current_time = datetime.now().strftime("%I:%M:%S %p") print(colorama.Fore.GREEN + f"{current_time} - NOTE: PRESENCE OF RECAPTCHA") sb.driver.uc_switch_to_frame("iframe") print(colorama.Fore.YELLOW + f"{current_time} - WAITING FOR RECAPTCHA TO BE SOLVED...") for i in range(100): try: recaptcha = sb.is_element_present('#recaptcha-anchor[aria-checked="true"]') except: current_time = datetime.now().strftime("%I:%M:%S %p") print(colorama.Fore.BLUE + f"{current_time} - WARNING: WAITING FOR RECAPTCHA TO BE SOLVED {100-i}...") sleep(5) else: if recaptcha: # Checking if recaptcha is True current_time = datetime.now().strftime("%I:%M:%S %p") print(colorama.Fore.MAGENTA + f"{current_time} - NOTE: RECAPTCHA HAS BEEN SOLVED") sb.driver.switch_to.default_content() return True else: current_time = datetime.now().strftime("%I:%M:%S %p") print(colorama.Fore.CYAN + f"{current_time} - WARNING: WAITING FOR RECAPTCHA TO BE SOLVED {100-i}...") sleep(5) sb.driver.switch_to.default_content() return False
Cookies Button
def remove_destraction(sb, excel_file_path): destractions = 0 if destractions != 0: return try: sb.click('//[@id="onetrust-close-btn-container"]/button') current_time = datetime.now().strftime("%I:%M:%S %p") print(colorama.Fore.BLUE + f"{current_time} - Cookies Click Button") except: current_time = datetime.now().strftime("%I:%M:%S %p") print(colorama.Fore.BLUE + f"{current_time} - NOTE: NO DESTRACTION THERE") else: sb.click('//[@id="onetrust-close-btn-container"]/button') current_time = datetime.now().strftime("%I:%M:%S %p") print(colorama.Fore.WHITE + f"{current_time} - NOTE: DESTRACTION HAS BEEN REMVOED") destractions = 1 return True
FILL EMAIL AND PASSWORD LOGIN PAGE
def login(sb, excel_file_path): check_notification(sb, excel_file_path) CloudFlare = '/html/body/app-root/div/div/app-login/section/div/div/mat-card/form/app-cloudflare-captcha-container/div' if sb.is_element_present(CloudFlare): sb.highlight(CloudFlare) current_time = datetime.now().strftime("%I:%M:%S %p") print(colorama.Fore.WHITE + f"{current_time} - CloudFlare Captcha Found") else: current_time = datetime.now().strftime("%I:%M:%S %p") print(colorama.Fore.YELLOW + f"{current_time} - CloudFlare Captcha not found.")
def submit_button_CloudFlare(sb, excel_file_path): try: sb.click('body > app-root > div > div > app-login > section > div > div > mat-card > form > button') current_time = datetime.now().strftime("%I:%M:%S %p") # Update current_time print(colorama.Fore.MAGENTA + f"{current_time} - Sign In (Button) click") check_notification(sb, excel_file_path) except: print(colorama.Fore.MAGENTA + f"{current_time} - ERROR: WE CANNOT FIND THE SUBMIT BUTTON ")
Check for the error message
def submit_button_Gcaptcha(sb, excel_file_path): sleep(1) try: submit_button = sb.driver.uc_click('.mat-focus-indicator.btn.mat-btn-lg.btn-block.btn-brand-orange.mat-stroked-button.mat-button-base.ng-star-inserted'.replace(" ",".")) print("Notice: SUBMIT BUTTON Clicked") except Exception as e: print(f"ERROR: {e}") return False