Tecnhotron commited on
Commit
a608f78
·
1 Parent(s): 192a95a
Files changed (1) hide show
  1. api.py +7 -2
api.py CHANGED
@@ -183,9 +183,14 @@ class DriverManager:
183
  logger.info("Checking for on-site ('Verify Human') captcha...")
184
  try:
185
  textarea_locator = (By.TAG_NAME, "textarea")
186
- textarea = WebDriverWait(driver, 5).until(EC.element_to_be_clickable(textarea_locator))
187
  captcha_present = True
188
- time.sleep(6)
 
 
 
 
 
189
  if not captcha_present:
190
  try:
191
  if driver.find_element(By.XPATH, "//*[contains(text(), 'Verify you are human')]").is_displayed():
 
183
  logger.info("Checking for on-site ('Verify Human') captcha...")
184
  try:
185
  textarea_locator = (By.TAG_NAME, "textarea")
186
+ textarea = WebDriverWait(driver, 2).until(EC.element_to_be_clickable(textarea_locator))
187
  captcha_present = True
188
+ time.sleep(10)
189
+ for selector in ['iframe[src*="api2/anchor"]', 'iframe[src*="recaptcha"]', '.g-recaptcha', '.h-captcha']:
190
+ try:
191
+ if driver.find_element(By.CSS_SELECTOR, selector).is_displayed():
192
+ captcha_present = True; break
193
+ except NoSuchElementException: continue
194
  if not captcha_present:
195
  try:
196
  if driver.find_element(By.XPATH, "//*[contains(text(), 'Verify you are human')]").is_displayed():