【发布时间】:2015-07-20 18:07:55
【问题描述】:
我正在尝试抓取一个网页,但这个特定页面不断返回包含 window.location.replace('web_address'); 的 if 和 else 语句,如果我执行 echo $crawler->html();,那么它实际上会将我的 Web 应用程序重定向到我的新网页'我实际上试图刮。
页面是 Salesforce。我不确定他们是否只是有某种机制,对任何传入的页面请求使用重定向。我能够安全地登录,但我无法检索实际的页面内容。
有没有人知道解决这个问题的方法,或者可能有不同的方法来做$client->request('GET', $link);?
谢谢
(编辑:我在代码/爬虫中得到的实际回报)
if (this.SfdcApp && this.SfdcApp.projectOneNavigator) {
SfdcApp.projectOneNavigator.handleRedirect('https://company.my.salesforce.com?ec=302&startURL=%2Fhome%2Fhome.jsp');
}
else if (window.location.replace) {
window.location.replace('https://company.my.salesforce.com?ec=302&startURL=%2Fhome%2Fhome.jsp');
}
else {
window.location.href ='https://company.my.salesforce.com?ec=302&startURL=%2Fhome%2Fhome.jsp';
}
我该如何解决这个问题?我可以不只是以某种方式从 Salesforce 上的页面获取实际页面内容,还是会像这样抓取/goute/curl 返回重定向?
【问题讨论】:
标签: php symfony web-scraping salesforce