2017-09-13 29 views
-1

我需要从whoscored.com数据,但是当我输入验证码如何从whoscored

import requests 
from bs4 import BeautifulSoup as soup 
url = "https://www.whoscored.com/Statistics" 
page_html = requests.get(url) 
page_soup = soup(page_html.content, 'html.parser') 

我刚开page_soup变量如下

<html style="height:100%"> 
    <head> 
    <meta content="NOINDEX, NOFOLLOW" name="ROBOTS"/> 
    <meta content="telephone=no" name="format-detection"/> 
    <meta content="initial-scale=1.0" name="viewport"/> 
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/> 
    <script src="/_Incapsula_Resource? 
SWJIYLWA=2977d8d74f63d7f8fedbea018b7a1d05" type="text/javascript"></script> 
    </head> 
    <body style="margin:0px;height:100%"><iframe frameborder="0" 
height="100%" marginheight="0px" marginwidth="0px" 
src="/_Incapsula_Resource?CWUDNSAI=18&amp;xinfo=10-12988947- 
0%200NNN%20RT%281505336855621%20883%29%20q%280%20-1%20-1%2077%29%20r%280%20- 
1%29%20B15%284%2c200%2c0%29%20U2&amp;incident_id=473000610021824233- 
81324132038935514&amp;edet=15&amp;cinfo=04000000" width="100%">Request 
unsuccessful. Incapsula incident ID: 473000610021824233-81324132038935514</iframe></body> 

是数据有什么办法在这种情况下获取数据?

回答

0

whoscored.com使用基于云的应用交付平台命名incapsula提供安全功能在以下方式Web服务器:

通过一个简单的改变您的网站的DNS记录(并且没有硬件或软件必需),您的网站流量将通过Incapsula全球分布式高性能服务器网络无缝布线。入站流量实时进行智能分析,阻止最新的Web威胁(例如,SQL注入攻击,刮板,恶意僵尸程序,评论垃圾邮件发送者)以及阻止三位数的千兆DDoS攻击。同时使用Incapsula的全球CDN加速和优化传出流量,加快载入时间,让欢迎访客加快速度。

来源:https://www.incapsula.com/faqs/

您的HTTP请求时被阻塞,你可以在HTML正文见:

Request unsuccessful. Incapsula incident ID: 473000610021824233-81324132038935514 

你想要做什么是绕过incapsula。有Python模块,将帮助你:https://github.com/ziplokk1/incapsula-cracker-py3

我建议仔细看看issue #4,因为你可能不得不做一些额外的工作,才能绕过incapsula。