title: How to pass captcha while scraping amazon website
body: <p>I am trying to scrape some basic data from amazon via python. Everything works great but I can not pass captcha control in most of cases. </p>
  
  <p>I tried to wait longer with sleep function but it doesn't work. 
  Is there any way to work around captcha control?</p>
  
  <pre><code>........
  
     def parse(url):
         headers = {
             'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'
      }
  
      try:
          # Retrying for failed requests
          for i in range(40):
              # Generating random delays
              sleep(randint(1,10))
              # Adding verify=False to avold ssl related issues
              response = requests.get(url, headers=headers, verify=False)
  
              if response.status_code == 200:
                  doc = html.fromstring(response.content)
                  XPATH_NAME = '//h1[@id="title"]//text()'
                  XPATH_SALE_PRICE = '//span[contains(@id,"ourprice") or contains(@id,"saleprice")]/text()'
                  XPATH_ORIGINAL_PRICE = '//td[contains(text(),"List Price") or contains(text(),"M.R.P") or contains(text(),"Price")]/following-sibling::td/text()'
                  XPATH_CATEGORY = '//a[@class="a-link-normal a-color-tertiary"]//text()'
                  XPATH_AVAILABILITY = '//div[@id="availability"]//text()'
  
                  RAW_NAME = doc.xpath(XPATH_NAME)
                  RAW_SALE_PRICE = doc.xpath(XPATH_SALE_PRICE)
                  RAW_CATEGORY = doc.xpath(XPATH_CATEGORY)
                  RAW_ORIGINAL_PRICE = doc.xpath(XPATH_ORIGINAL_PRICE)
                  RAw_AVAILABILITY = doc.xpath(XPATH_AVAILABILITY)
  
                  NAME = ' '.join(''.join(RAW_NAME).split()) if RAW_NAME else None
                  SALE_PRICE = ' '.join(''.join(RAW_SALE_PRICE).split()).strip() if RAW_SALE_PRICE else None
                  CATEGORY = ' &gt; '.join([i.strip() for i in RAW_CATEGORY]) if RAW_CATEGORY else None
                  ORIGINAL_PRICE = ''.join(RAW_ORIGINAL_PRICE).strip() if RAW_ORIGINAL_PRICE else None
                  AVAILABILITY = ''.join(RAw_AVAILABILITY).strip() if RAw_AVAILABILITY else None
  
                  if not ORIGINAL_PRICE:
                      ORIGINAL_PRICE = SALE_PRICE
                  # retrying in case of captcha
                  if not NAME:
                      raise ValueError('captcha')
                  data = {
                      'NAME': NAME,
                      'SALE_PRICE': SALE_PRICE,
                      'CATEGORY': CATEGORY,
                      'ORIGINAL_PRICE': ORIGINAL_PRICE,
                      'AVAILABILITY': AVAILABILITY,
                      'URL': url,
                  }
                  return data
              elif response.status_code==404:
                  break
      except Exception as e:
          print (e)
      def ReadAsin():
         ..........
  </code></pre>