[英]Dealing with pagination in web pages while using jsoup
I have been using jsoup to crawl through webpages of a particular website. 我一直在使用jsoup来浏览特定网站的网页。 Basically i am trying to extract all the href's that have a link of a pdf. 基本上,我试图提取所有具有pdf链接的href。 I have been successful in getting all the link of a particular page . 我已经成功获取了特定页面的所有链接。 But there are 10 such pages. 但是有10个这样的页面。 The web pages uses a logic of javascript _doPostBack() function to navigate to other pages. 网页使用javascript _doPostBack()函数的逻辑来导航到其他页面。 How do i get this done by jsoup. 我如何通过jsoup完成此操作。
This is how i am trying it right now 这就是我现在正在尝试的方式
Document document = Jsoup.connect(" some website name")
.data("__EVENTARGUMENT", __EVENTARGUMENT)
.data("__EVENTTARGET", __EVENTTARGET)
.data("__EVENTVALIDATION", __EVENTVALIDATION)
.data("__VIEWSTATEGENERATOR ", __VIEWSTATEGENERATOR)
.cookie("ASP.NET_SessionId", sessionId)
.followRedirects(true)
.timeout(0)
.userAgent(
"Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv1.8.1.6) Gecko/20070725 Firefox/2.0.0.6")
.post();
But i am getting a false url output. 但是我收到错误的网址输出。 I have defined all the variables before sending. 我已经定义了所有变量,然后再发送。
When I hit this kind of problem, here how I solve them: 当我遇到这类问题时,请按以下解决方法:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.