我需要从whoscored.com获取数据,但是当我键入以下代码时
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&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&incident_id=473000610021824233-
81324132038935514&edet=15&cinfo=04000000" width="100%">Request
unsuccessful. Incapsula incident ID: 473000610021824233-81324132038935514</iframe></body>
在这种情况下有什么方法可以获得数据吗?
发布于 2017-09-21 10:52:33
whoscored.com正在使用一个基于云的应用程序交付平台,名为In荚A,该平台以下列方式为way服务器提供安全特性:
通过对您的网站DNS记录的简单更改(并且不需要硬件或软件),您的网站流量将无缝地通过In荚A公司在全球分布的高性能服务器网络进行路由。实时分析输入流量,阻止最新的网络威胁(例如SQL注入攻击、刮刀器、恶意机器人、评论垃圾邮件发送者),并阻止三位数的千兆位DDoS攻击。同时,使用In荚A的全球CDN加速和优化传出流量,以加快负载时间,保持欢迎游客快速通过。
来源:https://www.incapsula.com/faqs/
您的http-请求被阻止了,在html正文中可以看到:
Request unsuccessful. Incapsula incident ID: 473000610021824233-81324132038935514
你要做的就是绕开In荚膜。有python模块可以帮助您完成以下工作:https://github.com/ziplokk1/incapsula-cracker-py3
我建议更仔细地查看第4期,因为您可能需要做一些额外的工作才能绕过In荚膜。
https://stackoverflow.com/questions/46207028
复制相似问题