Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
v1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
DedInc committed Jul 16, 2022
1 parent 42fb730 commit fb2bd36
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 3 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ driver = webdriver.Chrome(executable_path=getChromeDriver(), chrome_options=opti
driver.get('https://www.google.com/recaptcha/api2/demo')
solveRecaptcha(driver) #FOR PREDICTION ON YOUR PC

solveRecaptcha(driver, "https://myserver.com") #FOR PREDICTION IN YOUR SERVER (check server.py)
solveRecaptcha(driver, server="https://myserver.com") #FOR PREDICTION IN YOUR SERVER (check server.py)

solveRecaptcha(driver, invisible=True) #FOR PREDICTION INVISIBLE CAPTCHA
```
16 changes: 9 additions & 7 deletions byerecaptcha/byerecaptcha.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ def clickVerify():
driver.find_element_by_id('recaptcha-verify-button').click()
driver.switch_to.parent_frame()

def getFrames():
def getFrames(invisible=False):
global recaptchaFrame, CheckBox, imageFrame
recaptchaFrame = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.TAG_NAME, 'iframe')))
driver.switch_to.frame(recaptchaFrame)
CheckBox = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "recaptcha-anchor")))
if not invisible:
CheckBox = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "recaptcha-anchor")))
driver.switch_to.parent_frame()
while True:
frames = WebDriverWait(driver, 10).until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, 'iframe[src*="api2/bframe"]')))
Expand Down Expand Up @@ -346,7 +347,7 @@ def solveImage():
if result:
return result

def solveRecaptcha(browser, server=''):
def solveRecaptcha(browser, server='', invisible=False):
global driver, serverSolve, serverUrl

if server == '':
Expand All @@ -364,12 +365,13 @@ def solveRecaptcha(browser, server=''):
serverUrl = server
serverSolve = True

driver = browser
getFrames()
clickCheckBox()
driver = browser
if not invisible:
getFrames(invisible)
clickCheckBox()
while True:
try:
getFrames()
getFrames(invisible)
driver.switch_to.frame(imageFrame)
driver.switch_to.parent_frame()
break
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='byerecaptcha',
version='1.2.2',
version='1.2.3',
author='Maehdakvan',
author_email='visitanimation@google.com',
description='Google Recaptcha solver with selenium.',
Expand Down

0 comments on commit fb2bd36

Please sign in to comment.