iframe = driver.switch_to_frame("rc-imageselect")
recapcha = driver.find_element_by_xpath("/html/body/div[1]/div/div[3]/div[2]/div[1]/div[1]/div[4]")
recapcha.click()
time.sleep(1000)
iframe = driver.switch_to_frame("c-737168mpnn5c")
iframe = driver.find_element_by_xpath("/html/body/div[1]/div/div[3]/div[2]/div[1]/div[1]/div[4]")
iframe.click()
time.sleep(2)c:\Users\maksg\Desktop\parser\parser.py:31: DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
button = driver.find_element_by_xpath("/html/body/form/section[2]/div/button")
'WebDriver' object has no attribute 'switch_to_frame'
...
driver.get('https://digitask.ru')
time.sleep(10)
#тут что то ваше, что вызывает капчу
...
# поиск iframe с каптчами
c_frames = driver.find_elements(By.XPATH, '//iframe[contains(@src,"captcha") and contains(@title,"Main content")]')
print(f"Найдено {len(c_frames)} iframes с каптчей")
driver.switch_to.frame(c_frames[1]) #переключаеюся на второй iframe,у вас может быть другой
time.sleep(1)
some_btn = driver.find_element(By.XPATH, '//div[@id="menu-info"]') # установите ваш xpath, у меня нет такой кнопки как на вашей картинке
some_btn.click()
time.sleep(10)options = webdriver.ChromeOptions()
options.add_argument("user-data-dir=C:\\profile")c_frames = driver.find_elements_by_xpath('//iframe[contains(@src,"captcha") and contains(@title,"Main content")]')
Найдено 0 iframes с каптчей