RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
利用wget和队列模拟网络爬虫(不带判重程序)
/*
利用wget  指令和队列 模拟实现网络爬虫
利用自己的站点wzsts.host3v.com测试了一下
有一点错误
文件运行后拿到index.html
对于连接仅仅可以拿到 html 和htm 结尾的 而.com的没有考虑(设计文件可能多)
一次测试后了解到如下问题:
1.文件应该有树形话还原网站目录
2.文本记录的连接应该分类化
项目运行需要 su 根权限进行 
因为mv命令
本项目仅仅适合在linux下运行
本项目给真真的linux 爬虫做铺垫
*/
#include
using namespace std;
#include 
#include 
#include 
string s("index.html");
queueq;
 //略去一段
int main()
{
 //index.html
system("wget wzsts.host3v.com");

ofstream out("out.txt"); 
string mv("mv ");
string html(" html");
q.push(s);
  while(!q.empty())
   {
out<            
            
                                                            
文章名称:利用wget和队列模拟网络爬虫(不带判重程序)
文章链接:http://sczitong.cn/article/jojsjh.html