extension yung captcha solver mo ?
opo boss
tingin ako. kase kung sa code din kaya naman i async/await or ilagay sa .finally yan
ok po wait boss
tingin ako. kase kung sa code din kaya naman i async/await or ilagay sa .finally yan
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.chrome.service import Service
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support import expected_conditions as EC
#PATH
brave = 'C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe'
chrome = 'C:/Program Files/BraveSoftware/Brave-Browser/Application/chromedriver-win64/chromedriver.exe'
profile = 'C:/Users/Chuckie/AppData/Local/BraveSoftware/Brave-Browser/User Data/Default'
#OPTIONS
options = webdriver.ChromeOptions()
options.binary_location = brave
#options.add_argument('--headless')
options.add_argument(f'--user-data-dir={profile}')
options.add_argument('--windows-size=800,600')
options.add_extension('C:/Program Files/BraveSoftware/Brave-Browser/Application/chromedriver-win64/captcha.crx')
#options.add_argument('--disable-gpu')
#SERVICE
service = Service(chrome)
#DETAILS
url = '
You do not have permission to view the full content of this post.
Log in or register now.'
email = ''
pswrd = ''
#WEB AUTOMATION
web = webdriver.Chrome(service=service, options=options)
web.get(url)
print(web.title)
try:
popup = WebDriverWait(web, 5).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="radix-:r3:"]/div[2]/button')))
popup.click()
except Exception:
print('CLOSED')
try:
user = WebDriverWait(web, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="root"]/div/div/div[2]/form/div[1]/div[1]/input')))
user.send_keys(email)
paswrd = WebDriverWait(web, 5).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="root"]/div/div/div[2]/form/div[1]/div[2]/input')))
paswrd.send_keys(pswrd)
####DITO NA PO YUNG CAPTCHA DI KO PO ALAM PANO MAGANTAY BAGO ICLICK ANG LOGIN BUTTON (NOPECHA:CAPTCHA SOLVER PO YUNG EXTENSION)
# Proceed with login
login_button = WebDriverWait(web, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="root"]/div/div/div[3]/button[2]')))
login_button.click()
except Exception as e:
print(f'An error occurred: {str(e)}')
web.quit()
napakasimple lang po ng script ko wala po kasi ako background ito lang natutunan sa mga tutorials