如何在网站中找到新添加的链接? [英] How to find newly added links in website?

查看:92
本文介绍了如何在网站中找到新添加的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我在网站中查找新添加的链接.例如google web crawler .../spider ..


pleace help me to find newly added links in website.. like google web crawler.../spider..


package javaapplication33;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;


public class Main {

    public static void main(String[] args)  {
        try {
            URL my_url = new URL("http://www.tuteslanka.com/");
            BufferedReader br = new BufferedReader(new InputStreamReader(my_url.openStream()));
            String strTemp = "";
            while(null != (strTemp = br.readLine())){
            System.out.println(strTemp);
        }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

推荐答案

普拉萨德!

一整块地阅读整个页面,并将其输入到 HtmlAgilityPack ''s [
Hi Prasad!

Read the whole page in one chunk and feed it to the HtmlAgilityPack''s[^] Document.Load function. Then you can access all links on that page via the Links collection. All that is left to do for you now is to save all the links you found during one visit in a file or a DB and when you come back the next time do the same extraction process and compare the links you gathered this time against the ones you had saved.

That''s all there is to it!

Cheers!


这篇关于如何在网站中找到新添加的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆