以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  网页自动翻页问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=119163)

--  作者:yys983
--  发布时间:2018/5/18 18:12:00
--  网页自动翻页问题
请教下各位大神,我在网页抓取的时候,遇到如下代码怎么使用foxTABLE编写网页抓取自动翻页功能,跪谢了,自己学习了好多天,各种案例都看过了,还是不会写,求大神帮忙






<tfoot>
<tr>
<td colspan="2">
  <div class="batch">
   
            <input type="checkbox" class="J_TriggerAll">
    <input type="button" value="批量打印发货单" class="logis:batchPrintTicket">
<input type="button" value="批量打印运单" class="logis:batchPrintExpress">
                 </div>
           <input type="hidden" name="currentPage" value="4">
<div class="pagination">
<div class="page-top">
<a class="page-prev" href="#" title="翻到上一页"><span>上一页</span></a>
                                                <a href="#" >1</a>
                        <a href="#" >2</a>
                        <a href="#" >3</a>
                        <span class="page-cur">4</span>
                        <a href="#" >5</a>
                        <a href="#" >6</a>
                                <span class="page-break">...</span>
        <a href="#" >51</a>
        <a href="#" >52</a>
                                <a class="page-next" href="#" title="翻到下一页"><span>下一页</span></a>
        </div>
</div>

<script language="javascript" type="text/javascript">
function gotoPageP(newPage) {
var batchConfirmAction=document.getElementById(\'batchConfirmAction\');
if (batchConfirmAction){
batchConfirmAction.parentNode.removeChild(batchConfirmAction)
}
var batchConfirmEvent=document.getElementById(\'batchConfirmEvent\');
if (batchConfirmEvent){
batchConfirmEvent.parentNode.removeChild(batchConfirmEvent)
}
var f = document.forms["form1"];
if (f) {
for(var i=0;i<f.elements.length;i++){
if(f.elements[i].name=="currentPage"){
f.elements[i].value=newPage;
}
}
f.submit();
}
}
</script>
<!--翻页结束-->
</td>
</tr>
</tfoot>







--  作者:有点甜
--  发布时间:2018/5/18 18:28:00
--  

比如代码

 

Dim web As System.Windows.Forms.WebBrowser = e.Form.controls("webbrowser1").basecontrol

Dim Inputs = web.Document.GetElementsByTagName("a")
For Each Input As object In Inputs
    If Input.getAttribute("className") = "page-next" Then
        Input.InvokeMember("click")
        Exit For
    End If
Next


--  作者:yys983
--  发布时间:2018/5/25 22:11:00
--  
非常感谢,已搞定