请教此网页的列表分页如何采集
网站地址 http://www.ccud.org.cn/news/分页区域网页代码 <div class="thepg">
<li class='page2'><a href='/news/index.html'>首页</a> </li><li class='page2'><a href='#' onclick='javascript:if(!isIndex){go(curPage-1)};return false;'>上一页</a> </li><li class='page2'><a href='#' onclick='javascript:go(curPage+1);return false;'>下一页</a> </li><li class='page2'><a href='#' onclick='javascript:go(maxPage);return false;'>末页</a> </li>
<li id="pagingIndex" class='page2'></li> <li class='page3'></li><li class='page2' style='border:0px;margin:0 0 0 0;'><input name="pagenav" id="pagenav" type="text" size="2" onkeypress="javaScript:if(event.keyCode==13){go(this.value);}"></li><li class='page2'> <a href="#" onclick="javascript:go(document.getElementById('pagenav').value);return false;">Go</a>
<script language="JavaScript">
var docUrl = document.location.href;
var maxPage = 207;
var curPage = 1;
var isIndex = false;
var end = docUrl.lastIndexOf("/");
if(end > 0){
var realDocUrl = docUrl.substring(end);
var lastToken = realDocUrl.lastIndexOf("-");
var lastSuffix = realDocUrl.lastIndexOf(".html");
if( lastToken>0 && lastSuffix >0 && lastSuffix > lastToken){
curPage = realDocUrl.substring(lastToken+1,lastSuffix);
curPage = maxPage-curPage+1;
}else{
isIndex = true;
}
}
if(isNaN(curPage)){
curPage = 1;
}
var index = "<span><b>"+curPage+"/"+maxPage+"</b></span>";
document.getElementById("pagingIndex").innerHTML=index;
function go(page){
try{
var baseUrl = '/news/index';
var indexUrl = '/news/index.html';
//var page = document.getElementById("pagenav").value;
var url = '';
if (page >0&&page <=maxPage){
page = maxPage - page+1;
if(page <= 0){
page = 1;
url = baseUrl+'-'+page+'.html';
}else if(page >= maxPage){
url = indexUrl;
}else{
url = baseUrl+'-'+page+'.html';
}
document.location.href=url;
return true;
}else{
return false;
}
}catch(e){
alert("Sorry:"+e);
}
return false;
}
</script>
</div>
</div>
<div class="ccndMain_rt">
抓包分析到数据后用POST模式采集. 需要用抓包工具么,fiddle可以吧
页:
[1]