上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 42 下一页
摘要: 原创作品,允许转载,转载时请务必以超链接形式标明文章原始出处、作者信息和本声明。否则将追究法律责任。http://yeelone.blog.51cto.com/1476571/971591今天遇到这个错误:Traceback (most recent call last): File "t2.py"... 阅读全文
posted @ 2013-07-04 14:13 爱知菜 阅读(358) 评论(0) 推荐(0) 编辑
摘要: "在这一篇文章中,我们将使用 python 一个著名的网页解析库 BeautifulSoup 来实现一个标准的 Handler,并使用 广度优先算法 让爬虫工作起来。"本来如上文预想,是要用bs4的,不过 bs4 这个库太简单了,网上教程都有, 所以改用 selenium 。selenium是一个著... 阅读全文
posted @ 2013-07-01 11:14 爱知菜 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 在上一节我们回顾了python 多线程的知识。queue这个线程安全的序列正是python用来实现线程池的关键。我们可以把爬虫需要解析的URL放入这个序列中,供其它空闲的线程获取并使用。线程池的实现:import ThreadPool.dlthreadclass threadpool: def... 阅读全文
posted @ 2013-06-29 22:07 爱知菜 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 在将程序移植到python之前,先来复习一下python的多线程编程的相关知识。请看下面的一段代码:import timeimport threadingimport urllib.requestimport queueclass ThreadUrl(threading.Thread): de... 阅读全文
posted @ 2013-06-27 17:29 爱知菜 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 在上一篇中,我们提到了管道这个概念(pipeline),其实所有的管道都实现了同一接口叫 public interface IPipelineStep { void Process(Crawler crawler, PropertyBag propertyBag); }所有爬到的网址都将被构造Cr... 阅读全文
posted @ 2013-06-27 10:16 爱知菜 阅读(169) 评论(0) 推荐(0) 编辑
摘要: NCrawler 是一款 .net 上的开源爬虫,虽然它没有arachnode.net那么成熟完善,但是代码量小,设计结构好,很适合大家研读。在NCrawler.Demo项目下的Program.cs文件中,找到Main函数函数开头的一段代码,是打开HTTP协议的限制(对同一个WEB最多同时发起两个连... 阅读全文
posted @ 2013-06-26 22:15 爱知菜 阅读(315) 评论(0) 推荐(0) 编辑
摘要: __author__ = 'wei'# -*- coding: utf-8 -*-__author__ = 'wei'import getoptimport sysimport osimport py_compiledef setparams(): global srcpath,pycpath... 阅读全文
posted @ 2013-06-25 15:02 爱知菜 阅读(298) 评论(0) 推荐(0) 编辑
摘要: public static byte[] Stream2Bytes(ref Stream s) { if (s == null) { return null; } s.... 阅读全文
posted @ 2013-06-21 16:21 爱知菜 阅读(348) 评论(0) 推荐(0) 编辑
摘要: ROC曲线标识了为了达到某个TPR(识别率),伴随而来的该分类器的FPR(误判率)是多少,体现了这两者的关系。与ROC曲线类似的还有一个上升图,表示为了达到相应的识别率,需要投入的成本是多少(这个成本可以是样本数量)。ROC 曲线的横坐标表示 一个负的实例被当作正实例的概率(FPR),纵坐标表示一个... 阅读全文
posted @ 2013-06-14 17:48 爱知菜 阅读(870) 评论(0) 推荐(0) 编辑
摘要: logging.basicConfig(level=logging.INFO,filename=c.config_dict['logfile'],filemode='a',format='%(levelname)s[%(asctime)s]:%(message)s',datefmt='%Y-%m-%... 阅读全文
posted @ 2013-06-06 15:48 爱知菜 阅读(217) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 42 下一页