1.给自己一个强烈的目标(爬虫)2.大致了解这个目标如何实现3.安装环境(2.7.6)4.学习python基本概念和语法(3c学院)5.找一个该目标的类似的demo,跑起来玩一玩6.为了跑起来demo需要安装一些库(requests,bs4,html2text)7.为了装置库方便,找自动化的方法(p...
分类:
编程语言 时间:
2015-02-14 09:47:41
阅读次数:
190
2月有两场比赛,总分前八的有纪念品。第一场排第11,要拿到奖品毫无把握。。心血来潮写了个用来计算几场比赛总分排名的脚本,好让自己第一时间知道能不能得奖(囧),也稍微试下BeautifulSoup。# -*- coding: utf-8 -*-from bs4 import BeautifulSoup...
分类:
编程语言 时间:
2015-02-11 00:28:19
阅读次数:
211
# -*- coding:utf8 -*-from bs4 import BeautifulSoupimport os, sys, urllib2, urllibfrom multiprocessing.dummy import Pool as ThreadPoolurls = []def down...
分类:
编程语言 时间:
2015-02-09 20:14:15
阅读次数:
231
# -*- coding:utf8 -*-from bs4 import BeautifulSoupimport os, sys, urllib2, urllibimport thread, threadingclass downloader(threading.Thread): """docstr...
分类:
编程语言 时间:
2015-02-06 18:11:00
阅读次数:
201
bs4和urllib2抓取网页时很有可能会遇到的坑,都是泪。...
分类:
Web程序 时间:
2015-01-15 22:07:26
阅读次数:
219
动漫分类壁纸多线程下载,有Bug# -*- coding: utf-8 -*-import os,urllib2,re,urllibfrom bs4 import BeautifulSoupimport socketsocket.setdefaulttimeout(25) #in case...
分类:
编程语言 时间:
2015-01-15 21:55:13
阅读次数:
281
bs4:转换成unicode编码,http://www.crummy.com/software/BeautifulSoup/from bs4 import BeautifulSoupsoup = BeautifulSoup(open("index.html"))soup = BeautifulSou...
分类:
编程语言 时间:
2015-01-09 14:06:37
阅读次数:
194
以下代码,在执行结果中的中文出现乱码。from bs4 import BeautifulSoupimport urllib2request = urllib2.Request('http://www.163.com')response = urllib2.urlopen(request)html_d...
分类:
Web程序 时间:
2014-12-16 16:30:13
阅读次数:
199
bs3即BeautifulSoup,官方已经停止维护全部转到bs4(BeautifulSoup4)了,官方建议使用bs4兼容python3和python2,可以参看官方文档那么,问题来了。当import lxml.html.soupparser的时候报bs包找不到。可以用以下方法解决:>>> imp...
分类:
Web程序 时间:
2014-11-08 18:07:13
阅读次数:
189