网页获取

1.javascript出于安全机制不允许跨域操作的。因此不能抓取其他网站的内容。

   这时可以直接用php函数file_get_contents(url)就能获取到了。

2.<meta http-equiv="refresh" content="5; url=http://www.dreamdu.com/" />网页头加上这个表示5秒后跳转到url,不加url是5秒刷新

原文地址:https://www.cnblogs.com/li-mei/p/5857160.html