Improve reCaptcha 2.0 solving automation script (Selenium)
Question: I've written a python with selenium code to solve [new behaviour
captcha](http://scraping.pro/no-captcha-recaptcha-challenge/). But something
is lacking as to fully imitate user behaviour: the code works to locate and
click on a captcha, yet after that google sets up additional pictures check
[![enter image description
here](http://i.stack.imgur.com/mStXU.jpg)](http://i.stack.imgur.com/mStXU.jpg)

which is not easy to automate. How to improve the code to solve captcha
immediately without pictures check (letting google no hint of robot presence)?

[reCaptcha testing ground](http://tarex.ru/testdir/recaptcha/recaptcha.php).

## Python code

    
    
    from time import sleep
    from random import uniform
    from selenium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.common.keys import Keys
    from selenium.webdriver.support.wait import WebDriverWait
    from selenium.webdriver.common.action_chains import ActionChains
    from selenium.webdriver.support import expected_conditions as EC
    
    # to imitate hovering 
    def hover(element):  
        hov = ActionChains(driver).move_to_element(element)
        hov.perform()
    # optional: adding www.hola.org proxy profile to FF (extention is installed on FF, Win 8) 
    ffprofile = webdriver.FirefoxProfile()
    hola_file = '/Users/Igor/AppData/Roaming/Mozilla/Firefox/Profiles/7kcqxxyd.default-1429005850374/extensions/hola/hola_firefox_ext_1.9.354_www.xpi'
    ffprofile.add_extension(hola_file) 
    # end of the optional part
    
    driver = webdriver.Firefox(ffprofile) 
    url='http://tarex.ru/testdir/recaptcha/recaptcha.php'
    
    # open new tab, also optional 
    driver.find_element_by_tag_name('body').send_keys(Keys.COMMAND + 't') 
    driver.get(url)
    
    recaptchaFrame = WebDriverWait(driver, 10).until(
            EC.presence_of_element_located((By.TAG_NAME ,'iframe'))
            )
    frameName = recaptchaFrame.get_attribute('name')
    
    # move the driver to the iFrame... 
    driver.switch_to_frame(frameName)
    
    # *************  locate CheckBox  **************
    CheckBox = WebDriverWait(driver, 10).until(
            EC.presence_of_element_located((By.ID ,"recaptcha-anchor"))
            )
    
    # *************  hover CheckBox  ***************
    rand=uniform(1.0, 1.5)
    print('\n\r explicit wait for ', rand , ' seconds...')
    sleep(rand) 
    hover(CheckBox)
    
    # *************  click CheckBox  ***************
    rand=uniform(0.5, 0.7)
    print('\n\r explicit wait for ', rand , 'seconds...')
    sleep(rand)
    # making click on CheckBox... 
    clickReturn= CheckBox.click()
    print('\n\r after click on CheckBox... \n\r CheckBox click result: ' , clickReturn)
    


Answer: you can't do that, I think the image obstacle is used when too many requests
are done from the same IP anyway, so you can't bypass it, what you can do is
use proxies

