The crawler encounters the problem that the webpage is reload. reload
Some websites will add this. window. location. reload () to the page for anti-collection. At this time, you will get the following code:
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
</Head>
<Body>
<Iframe height = "0" width = "0" style = "border: 0px;" src = "http: // www. ***. cn/*** _cookie.html "> </iframe>
<Script type = "text/javascript">
SetTimeout (function (){
This. window. location. reload ();
},1000 );
</Script> </body>
</Html>
In this way, you will not be able to get the content of his webpage, but the browser can display it normally.
At this time, you need to add a cookie when crawling. The more direct one is to add the cookie when accessing the browser statically. You can also Dynamically Retrieve the cookie Based on the address (I have not tried dynamic retrieval)
How does a web crawler extract regular expressions of web page information or use a third-party toolkit?
Example html parser jsoup
Jsoup is recommended for use with powerful functions. For more information, see
Http://zhidao.baidu.com/question/552336025? & Amp; oldq = 1 # answer-1391273085
Send me a private email if you have any questions
I want to create a web crawler for the problem that the webpage source code does not correspond to the webpage content. However, the crawled data is not the current page information. For more information, see the URL format and code it, example: "url? Url = ..."