PHP 爬取网页的时候遇到JS定时跳转
抓取到的网页内容为
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-store" />
<meta http-equiv="Connection" content="Close" />
<script>
function JumpSelf()
{
self.location="/?WebShieldSessionVerify=PIHIFboME3yzpTl2p9T2";
}
</script>
<script>setTimeout("JumpSelf()",700);
</script>
</head>
<body>
</body>
</html>
爬取程序得到状态码是200
用fiddler抓取浏览器链接发现状态码是302
header中有Location: /(e24a2c455vo1xe45nlqfme55)/default2.aspx
是不是因为curl爬取到JS页面因为是定时700毫秒跳转所以curl就以为没有跳转就停止了?这该如何解决?用正则去匹配吗?
拔哥小树杈
10 years, 7 months ago