的問題是http://taskbucks.com/artcl_out?artcl=24713df2ffb748ec8464638df61d2298頁面上,有一個「文件準備就緒」事件偵聽器,使瀏覽器提交負載的形式最終將您重定向到最後一頁:
<script type="text/javascript">
$(document).ready(function() {
$("#fsid").val(new Fingerprint().get());
$("#fsidpe").val(new Fingerprint({canvas: true}).get());
submitReport();
});
function submitReport() {
$("#articleCheck").submit();
}
</script>
urllib2
是不是瀏覽器,並且不會在網頁加載時提交表單。
相反,我會用像Mechanize
工具,以提交此表:
>>> import mechanize
>>>
>>> br = mechanize.Browser()
>>> br.open("http://tbk.bz/t72qx4v3")
>>> br.select_form("articleCheck")
>>> br.submit()
>>> br.geturl()
'http://www.holidayiq.com/blog/6-high-octane-adventure-sports-in-india-that-will-get-your-heart-in-your-throat-1831.html?utm_source=taskbucks&utm_medium=share&utm_campaign=referral&channel=taskbucks'
發佈您的代碼片段 – phoenix