Trying to scrape a web page with CasperJS. Webpage checks to see if the browser is an IE 6/7.
Passing an userAgent with casperjs doesn't seem to satisfy its condition. UserAgent passed: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Following is the check being made by the page to determine the browser
agt = navigator.userAgent.toLowerCase();
browserType = navigator.appName;
if( ((browserType.indexOf("xplorer") != -1)
&& (agt.indexOf("msie 6.") != -1))
|| ((browserType.indexOf("xplorer") != -1)
&& (agt.indexOf("msie 7.") != -1)) )
{
}
else
{
alert("This "+ browserType + " Version is not supported by this application. Please use Internet Explorer 6.x or Internet Explorer 7.x.");
window.close();
}
Following is the debug info from casperjs.
[info] [remote] [alert] This Netscape Version is not supported by this applicat on. Please use Internet Explorer 6.x or Internet Explorer 7.x.
[warning] [phantom] Loading resource failed with status=fail (HTTP 200): http://
Any pointers on setting window.navigator
object before page redirect?