我想学习制作网络爬虫/蜘蛛程序,但我需要有人指导我开始的方向。
基本上,我的蜘蛛程序将搜索音频文件并对其进行索引。
我在考虑如何实现它。听说使用PHP会非常慢,我会VB.NET, 是否可以派上用场?
我想使用谷歌的文件类型搜索来获取要爬取的链接。这样做可以吗?
我想学习制作网络爬虫/蜘蛛程序,但我需要有人指导我开始的方向。
基本上,我的蜘蛛程序将搜索音频文件并对其进行索引。
我在考虑如何实现它。听说使用PHP会非常慢,我会VB.NET, 是否可以派上用场?
我想使用谷歌的文件类型搜索来获取要爬取的链接。这样做可以吗?
这里有一个教程链接,介绍如何使用Java编写网络爬虫。 http://java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/ 如果你搜索一下,也可以找到其他语言的教程。
System.Data.SqlClient
命名空间。对于其他任何数据库,您需要查看 System.Data.OleDb
命名空间。如果您希望此程序在无人值守状态下运行,最好使用控制台 VB 应用程序。 - Chris Diver伪代码应该如下所示:
Method spider(URL startURL){
Collection URLStore; // Can be an arraylist
push(startURL,URLStore);// start with a know url
while URLStore ! Empty do
currURL= pop(URLStore); //take an url
download URL page;
push (URLx, URLStore); //for all links to URL in the page which are not already followed, then put in the list
在Java中从网页读取一些数据,您可以执行以下操作:
URL myURL = new URL("http://www.w3.org");
BufferedReader in = new BufferedReader( new InputStreamReader(myURL.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) //you will get all content of the page
System.out.println(inputLine); // here you need to extract the hyperlinks
in.close();