2017-09-13 291 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。