title: Integrating anticaptcha with selenium
body: <p>I am using Selenium/Python to try and fill out a form and than fill out the recaptcha. I found python-anticaptcha and bought $10 in credits, and everything is working, the captcha comes up, but than nothing happens. I tried to look for answers for a few hours/consulted their api and examples, but could not find anything. Ultimately, the captcha should work and then the website would generate a table which I am trying to web-scrape</p>
  
  <p>This is what it ends up looking like, <a href="https://i.stack.imgur.com/UjmbS.jpg" rel="nofollow noreferrer"></a>but nothing happens and after a minute or so it usually quits, this is the code</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  from bs4 import BeautifulSoup
  from python_anticaptcha import AnticaptchaClient, NoCaptchaTaskProxylessTask
  import re
  import pandas as pd
  import os
  import time
  import requests
  
  url = "https://claimittexas.org/app/claim-search"
  driver = webdriver.Safari()
  driver.implicitly_wait(30)
  driver.get(url)
  
  wait = WebDriverWait(driver, 30)
  result = driver.find_element_by_xpath('//*[@id="lastName"]')
  driver.execute_script("arguments[0].value='Al';",result)
  time.sleep(2)
  result.submit()
  
  api_key = #MYAPIKEY
  site_key = '6LeQLyEUAAAAAKTwLC-xVC0wGDFIqPg1q3Ofam5M'  # grab from site
  
  time.sleep(2)
  client = AnticaptchaClient(api_key)
  task = NoCaptchaTaskProxylessTask(url, site_key)
  job = client.createTask(task)
  job.join()
  token = job.get_solution_response()
  requests.post(url, data={'g-recaptcha-response': token}).text
  </code></pre>