Unable to scrape parts of a page webpage with scrapy

Viewed 389

I'm using scrapy to crawl an e-commerce website I'm experienced with simpler websites where scrapy alone or with splash/selenium handle most cases. I have a new situation where I have no experience to deal with. From my investigations it could be like a captcha but without any request to the user.

I've made tests to solve it with scrapy alone, scrapy and selenium with no success.

With my scrapy request I receive the following response

<!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <title>Challenge Validation</title>
      <link rel="stylesheet" type="text/css" href="/_sec/cp_challenge/sec-2-9.css">
      <script type="text/javascript">function cp_clge_done(){location.reload(true);}</script>  
      <script src="/_sec/cp_challenge/sec-cpt-int-2-9.js" async defer></script>
      <script type="text/javascript">sessionStorage.setItem('data-duration', 5);</script>
    </head>
    <body>
      <div class="sec-container">
        <div id="sec-text-container"><iframe id="sec-text-if" class="custmsg" src="https://beta.elcorteingles.es/sgfm/statics/eci_non_food/contents/cc/cca.html"></iframe></div>
        <div id="sec-if-container">
          <iframe id="sec-cpt-if" class="crypto" data-key="" data-duration=5 src="/_sec/cp_challenge/ak-challenge-2-9.htm"></iframe>
        </div>
      </div>
    </body>
  </html>

With the chrome inspector i see also noticed two GET requests (non-java) that might be related:

check -> returns HTML ( ... <title>RP iframe</title> ...)
check-session?origin=https%3A%2F%2Fwww.elcorteingles.es -> returns HTML (...<title>OP iframe</title>...)

Using scrapy shell with view(response) it looks like a captcha situation, waiting for something. Page example could be:

scrapy shell "https://www.elcorteingles.es/supermercado/0110120903000022-coosur-aceite-de-oliva-intenso-1-botella-1-l/"

The title 'challenge validation' suggests it. I have no idea how to handle with this case. From research, I've seen solutions involving scrapy middleware but for cases where input was asked from the user. I found no example similar to this case. Any guidance on how to proceed is appreciated.

0 Answers
Related