UC Mode: Video 3 is now on YouTube!
Full method list so far:
driver.uc_open(url)
driver.uc_open_with_tab(url)
driver.uc_open_with_reconnect(url, reconnect_time=None)
driver.uc_open_with_disconnect(url, timeout=None)
driver.reconnect(timeout)
driver.disconnect()
driver.connect()
driver.uc_click(
selector, by="css selector",
timeout=settings.SMALL_TIMEOUT, reconnect_time=None)
driver.uc_gui_press_key(key)
driver.uc_gui_press_keys(keys)
driver.uc_gui_write(text)
driver.uc_gui_click_x_y(x, y, timeframe=0.25)
driver.uc_gui_click_captcha(frame="iframe", retry=False, blind=False)
# driver.uc_gui_click_cf(frame="iframe", retry=False, blind=False)
# driver.uc_gui_click_rc(frame="iframe", retry=False, blind=False)
driver.uc_gui_handle_captcha(frame="iframe")
# driver.uc_gui_handle_cf(frame="iframe")
# driver.uc_gui_handle_rc(frame="iframe")
ok this video was the best i watched so far and you said that google recaptcha is better than cloudflare yeah you are right but there is also a work around for google captcha bypass actually just switch to iframe click in checkbox and click the headphone icon after that get the audio and using speech to text api we can convert that speech to text and kabooom done even google captcha cant stand a chance lol🤣 if its uc mode it will be even more good bypassing
@mdmintz make this a function and add it to sb if possible its awesome and thanks for the idea @ArchLinuxAddict
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import requests
from wit import Wit
import time
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=options)
driver.get("https://www.google.com/recaptcha/api2/demo")
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR,"iframe[src^='https://www.google.com/recaptcha/api2/anchor']")))
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "span#recaptcha-anchor"))).click()
driver.switch_to.default_content()
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH,"/html/body/div[2]/div[4]/iframe")))
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div/div[3]/div[2]/div[1]/div[1]/div[2]/button"))).click()
# Get audio's link
t = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.CLASS_NAME, 'rc-audiochallenge-tdownload')))
t = t.find_element(By.TAG_NAME, 'a')
t = t.get_attribute('href')
# Download audio file
r = requests.get(t, allow_redirects=True)
open('audio.mp3', 'wb').write(r.content)
def transcribe_audio_to_text(audio_file_path, wit_token):
client = Wit(access_token=wit_token)
with open(audio_file_path, 'rb') as audio_file:
response = client.speech(audio_file, {'Content-Type': 'audio/mpeg'})
return response.get('text', '')
transcription = transcribe_audio_to_text('audio.mp3','SERVER_API_Token') #wit is completely free no limits
WebDriverWait(driver,10).until(EC.presence_of_element_located((By.ID, 'audio-response'))).send_keys(transcription)
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.CLASS_NAME, 'verify-button-holder'))).click()
time.sleep(20)
The new video (Undetectable Automation 4) is now available on YouTube: https://github.com/seleniumbase/SeleniumBase/issues/3296