Python Forum
Parsing html page and working with checkbox (on a captcha)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parsing html page and working with checkbox (on a captcha)
#16
Quote:AttributeError: 'list' object has no attribute 'select'
Return a list object to get,so most use it like this.
elem_capt[0].select()
Here my setup with different tests,but has to solve Buster manually.
So most look at links posted that try to bypass Buster solver.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time

#--| Setup
options = Options()
#options.add_argument("--headless")
#options.add_argument('--log-level=3')
options.add_argument("user-data-dir=cookies") # Try so save cookies local
options.add_argument('--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36')
options.add_argument("--disable-blink-features")
options.add_argument("--disable-blink-features=AutomationControlled")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
browser = webdriver.Chrome(executable_path=r'C:\cmder\bin\chromedriver.exe', options=options)
#--| Parse or automation
browser.get('https://www.google.com/recaptcha/api2/demo')
# Find iframe
captcha_iframe = WebDriverWait(browser, 10).until(ec.presence_of_element_located((By.TAG_NAME, 'iframe')))
# Move to element
ActionChains(browser).move_to_element(captcha_iframe).click().perform()
# Click on checkbox
captcha_box = WebDriverWait(browser, 10).until(ec.presence_of_element_located((By.ID, 'g-recaptcha-response')))
browser.execute_script("arguments[0].click()", captcha_box)
time.sleep(30) # Time to solve
send = browser.find_elements_by_css_selector('#recaptcha-demo-submit')
send[0].click() 
Reply


Messages In This Thread
RE: Parsing html page and working with checkbox (on a captcha) - by snippsat - Feb-03-2021, 04:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to bypass Cloudflare checkbox challenge Pavel_47 1 3,643 Sep-13-2024, 03:13 PM
Last Post: kucingkembar
Photo Disable checkbox of google maps markers/labels using selenium erickkill 0 1,958 Nov-25-2021, 12:20 PM
Last Post: erickkill
  <title> django page title dynamic and other field (not working) lemonred 1 2,953 Nov-04-2021, 08:50 PM
Last Post: lemonred
  Automating Captcha form submission with Mechanize Dexty 2 4,361 Aug-03-2021, 01:02 PM
Last Post: Dexty
  HTML multi select HTML listbox with Flask/Python rfeyer 0 6,237 Mar-14-2021, 12:23 PM
Last Post: rfeyer
  Saving html page and reloading into selenium while developing all xpaths Larz60+ 4 6,018 Feb-04-2021, 07:01 AM
Last Post: jonathanwhite1
  API auto-refresh on HTML page using Flask toc 2 14,201 Dec-23-2020, 02:00 PM
Last Post: toc
  Selenium Parsing (unable to Parse page after loading) oneclick 7 7,725 Oct-30-2020, 08:13 PM
Last Post: tomalex
  Help: Beautiful Soup - Parsing HTML table ironfelix717 2 3,895 Oct-01-2020, 02:19 PM
Last Post: snippsat
  [FLASK] checkbox onclick event Mad0ck 2 6,730 May-14-2020, 09:35 AM
Last Post: Mad0ck

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020