当我尝试加载此页面时,我被阻止,我得到一个javascript字符串,我必须解决才能被重定向。出于某种原因,PhantomJS无法解决此javascript重定向问题。有没有人知道这个?
这是网址:
http://www.electronicsforless.ca/search/results.html?search_in_description=1&keyword=samsung+hdtv
这是我的幽灵代码:
var webPage = require('webpage');
var system = require('system');
var fs = require('fs');
var args = system.args;
var page = webPage.create();
var url = args[1];
page.open(url, function(status) {
var content = page.content;
fs.write('test.txt', content, 'w');
phantom.exit();
});
这是输出:
<html><head><title>You are being redirected...</title>
<noscript>Javascript is required. Please enable javascript before you are allowed to see this page.</noscript>
<script>var s={},u,c,U,r,i,l=0,a,e=eval,w=String.fromCharCode,sucuri_cloudproxy_js='',S='bT0iOCIuc2xpY2UoMCwxKSArICAnJyArImVzZWMiLnN1YnN0cigwLDEpICsgJ0VlJy5zbGljZSgxLDIpKyAnJyArJycrU3RyaW5nLmZyb21DaGFyQ29kZSg1NykgKyAiIiArImMiLnNsaWNlKDAsMSkgKyAnTXY5OScuc3Vic3RyKDMsIDEpICsiMSIgKyAndjRiJy5jaGFyQXQoMikrU3RyaW5nLmZyb21DaGFyQ29kZSgweDMxKSArICAnJyArIAonMXVQYScuc3Vic3RyKDMsIDEpICsiNXN1Y3VyIi5jaGFyQXQoMCkrICcnICsiOXNlYyIuc3Vic3RyKDAsMSkgKyAiIiArJ3FRZCcuY2hhckF0KDIpKyd6MGInLmNoYXJBdCgyKSsnZ01hJy5jaGFyQXQoMikrU3RyaW5nLmZyb21DaGFyQ29kZSg5NykgKyAiZHN1Y3VyIi5jaGFyQXQoMCkrJ1tnQjgnLnN1YnN0cigzLCAxKSArJ2pMOScuY2hhckF0KDIpK1N0cmluZy5mcm9tQ2hhckNvZGUoMHg2MykgKyAiZWMiLmNoYXJBdCgwKSArICAnJyArIAonaFI5Jy5jaGFyQXQoMikrIjIiICsgICcnICsgCidHZ0E1Jy5zdWJzdHIoMywgMSkgKyc0JyArICBTdHJpbmcuZnJvbUNoYXJDb2RlKDEwMSkgKyBTdHJpbmcuZnJvbUNoYXJDb2RlKDB4NjYpICsgICcnICsiYiIgKyAiMyIgKyAnNCcgKyAgICcnICsiNiIgKyAgJycgKyAKJ01xRjYnLnN1YnN0cigzLCAxKSArJyc7ZG9jdW1lbnQuY29va2llPSdzJysndXN1Y3VyJy5jaGFyQXQoMCkrICdzdWN1cmljJy5jaGFyQXQoNikrJ3N1Jy5jaGFyQXQoMSkrJ3InKydpJysnXycrJ2MnKydzdWN1bCcuY2hhckF0KDQpKyAnb3N1Jy5jaGFyQXQoMCkgKydzdXUnLmNoYXJBdCgyKSsnZCcrJ3BzdScuY2hhckF0KDApICsncicuY2hhckF0KDApKydvJysnc3VjdXgnLmNoYXJBdCg0KSsgJ3N1Y3V5Jy5jaGFyQXQoNCkrICdfc3VjJy5jaGFyQXQoMCkrICd1JysndScrJ2knKydkJysnXycrJ3N1Y3UyJy5jaGFyQXQoNCkrICdzdWN1cjgnLmNoYXJBdCg1KSArICc0JysnJysnc3VjdTYnLmNoYXJBdCg0KSsgJzNzdWMnLmNoYXJBdCgwKSsgJzgnKydhc3VjdScuY2hhckF0KDApICArJ2EnKydzdWN1cmlhJy5jaGFyQXQoNikrIj0iICsgbSArICc7cGF0aD0vO21heC1hZ2U9ODY0MDAnOyBsb2NhdGlvbi5yZWxvYWQoKTs=';L=S.length;U=0;r='';var A='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';for(u=0;u<64;u++){s[A.charAt(u)]=u;}for(i=0;i<L;i++){c=s[S.charAt(i)];U=(U<<6)+c;l+=6;while(l>=8){((a=(U>>>(l-=8))&0xff)||(i<(L-2)))&&(r+=w(a));}}e(r);</script></head></html>