#?!/usr/bin/env?python??
#?-*-?coding:utf-8?-*-??
???
import?Queue??
import?threading??
import?time??
import?re,urllib2
from?bs4?import?BeautifulSoup
???
class?WorkMan...
分类:
编程语言 时间:
2015-10-26 15:43:56
阅读次数:
171
//js部分? var editor; KindEditor.ready(function(K) { editor = K.create(‘#description‘, { minWidth:480, minHeight:300, items:["undo", "redo","justifyleft","justifycenter","justifyright", ? ? ? ...
分类:
其他好文 时间:
2015-10-21 10:56:11
阅读次数:
248
广度优先算法:# -*- coding: utf-8 -*- import urllibimport urllib.requestfrom bs4 import BeautifulSoupimport threadingmylock = threading.RLock()class Crawler:...
分类:
编程语言 时间:
2015-10-20 17:44:52
阅读次数:
278
#!/usr/bin/python#coding:utf-8import timeimport urllibimport urllib2from bs4 import BeautifulSoupimport reimport cookielibdef main0(): unix_timenow...
分类:
编程语言 时间:
2015-10-17 21:54:17
阅读次数:
229
方法一:pip install beautifulsoup4方法二:在官网下载安装包后,放在python目录下--运行cmd--进入bs4安装包路径--输入setup.py install测试:from bs4 import BeautifulSoup 没有报错
example: http://xyzp.haitou.cc/article/722427.html首先是直接下载好每个页面,可以使用 os.system( "wget "+str(url)) 或者urllib2.urlopen(url) ,很简单不赘述。然后,重头戏,进行信息抽取:#!/usr/....
分类:
数据库 时间:
2015-09-29 18:47:43
阅读次数:
190
下面我们创建一个真正的爬虫例子爬取我的博客园个人主页首页的推荐文章列表和地址scrape_home_articles.pyfrom urllib.request import urlopenfrom bs4 import BeautifulSoupimport rehtml = urlopen("h...
分类:
编程语言 时间:
2015-09-23 13:12:05
阅读次数:
208
有几个注意点:# -*- coding: utf-8 -*- # func passport jw.qdu.edu.cnimport reimport urllibimport urllib.requestimport jsonfrom bs4 import BeautifulSoupclass t...
分类:
编程语言 时间:
2015-09-22 21:54:10
阅读次数:
222
一 简单使用方法1. 把所有文件上传到程序所在目录下,例如:http://你的域名/editor/。2. 在此目录下创建attached文件夹,并把权限改成777。3. 要添加编辑器的地方加入以下代码。(原来的TEXTAREA或其它编辑器可以先注释。) 这里[]里的内容要根据你的实际情况修改...
分类:
其他好文 时间:
2015-09-21 19:20:06
阅读次数:
337
handle_excpetion.pyfrom urllib.request import urlopenfrom urllib.error import HTTPErrorfrom bs4 import BeautifulSoupimport sysdef getLogo(url): try...
分类:
编程语言 时间:
2015-09-16 17:30:18
阅读次数:
244