October 24, 2024
Chicago 12, Melborne City, USA
python

How to bypass press and hold captcha using python and selenium?


I am using Selenium and Python to scrape data from the iHerb website. However, I am encountering a captcha that is preventing me from successfully extracting the desired information. How can I overcome this captcha challenge and proceed with the scraping process?

I attempted to use Selenium actions to press and hold an element, but it was unsuccessful because it is located within a shadow root containing an iframe.
I tried the code
`

element = driver.find_element_by_css_selector('#px-captcha')
            action = ActionChains(driver)
            action.click_and_hold(element)
            action.perform()
            time.sleep(10)
            action.release(element)
            action.perform()
            time.sleep(0.2)
            action.release(element)



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video