How to capture the webpage content by JS pagination

Source: Internet
Author: User
How can I capture the webpage content paginated by JS? I want to capture the content of a website. this website paging mechanism uses js. Details: [size = 10px] HTMLcode & lt; ahref = & quot; javascript: gogage (pageno + 1) & quot; class = & quot; navigation & quot; & gt; next page <How can I capture the content of a webpage paginated by JS?
I want to capture the content of a website. The paging mechanism of this website uses js. The details are as follows:

[Size = 10px]
HTML code
  Next page


JScript code
      var pageno=1;    function gogage(pno){      tbl.firstPage();      pageno=1;      for(var i=1; (i < pno||pno==-1)&&i
  


HTML code
  

















































































Please enlighten me!------ Solution --------------------Help me!------ Solution --------------------Take down the html page, and take down the data at the location specified by "# xmldso", that is, all the content. It has little to do with paging.------ Solution --------------------Help!------ Solution --------------------Capture webpage content using htmlparser (1)Import org.html parser. Node;Import org.html parser. NodeFilter;Import org.html parser. Parser;Import org.html parser. filters. TagNameFilter;Import org.html parser. tags. TableTag;Import org.html parser. util. NodeList;/**** Title:* Function overview:* Copyright: cityyouth.cn (c) 2005* Company: Shanghai City Youth Network* Creation Time: 2005-12-21* Modification time:* Reason for modification:** @ Author Zhang Wei* @ Version 1.0*/Public class TestYahoo {Public static void testHtml (){Try {String sCurrentLine;String sTotalString;SCurrentLine = "";STotalString = "";Java. io. InputStream l_urlStream;Java.net. URL l_url = new java.net. URL (Http://sports.sina.com.cn/iframe/nba/live ");Java.net. HttpURLConnection l_connection = (java.net. HttpURLConnection) l_url. OpenConnection ();Rochelle connection.connect ();Rochelle urlstream = Rochelle connection.getinputstream ();Java. io. BufferedReader l_reader = new java. io. BufferedReader (New java. io. InputStreamReader (l_urlStream ));While (sCurrentLine = l_reader.readLine ())! = Null ){STotalString + = sCurrentLine;}System. out. println (sTotalString );System. out. println ("===================== ");String testText = extractText (sTotalString );System. out. println (testText );} Catch (Exception e ){E. printStackTrace ();}}/*** Extract plain text information** @ Param inputHtml* @ Return*/Public static String extractText (String inputHtml) throws Exception {StringBuffer text = new StringBuffer ();Parser parser = Parser. createParser (new String (inputHtml. getBytes (),"8859_1"), "8859-1 ");// Traverse all nodesNodeList nodes = parser. extractAllNodesThatMatch (new NodeFilter (){Public boolean accept (Node node ){Return true;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.