先决条件:Python环境然后装了下模块Beautifulsoup4,lxml,requests笔者当然推荐Anaconda了,在此基础上pip或者conda安装就行如,C:\>condainstalllxmlbeautifulsoup4requests其实爬下来倒不是很难,不管是requests还是urllib,一下就能把页面download下来,在抓下来之后的..
分类:
其他好文 时间:
2015-11-19 19:12:25
阅读次数:
422
下载博客园的logofrom urllib.request import urlretrievefrom urllib.request import urlopenfrom bs4 import BeautifulSouphtml = urlopen("http://www.cnblogs.com"...
分类:
编程语言 时间:
2015-11-19 12:38:18
阅读次数:
165
import urllib import urllib2 import json import random import sys import os import codecs DEBUG=False # function get the current dirctory def cur_file...
分类:
编程语言 时间:
2015-11-15 09:40:56
阅读次数:
884
1 __author__ = 'minmin' 2 #coding:utf-8 3 import re,urllib,sgmllib,os 4 5 #根据当前的url获取html 6 def getHtml(url): 7 page = urllib.urlopen(url) 8 ...
分类:
其他好文 时间:
2015-11-13 18:43:00
阅读次数:
297
1 __author__ = 'minmin' 2 #coding:utf-8 3 import re,urllib,sgmllib 4 5 #根据当前的url获取html 6 def getHtml(url): 7 page = urllib.urlopen(url) 8 ht...
分类:
其他好文 时间:
2015-11-13 18:41:10
阅读次数:
250
1 __author__ = 'minmin' 2 #coding:utf-8 3 import re,urllib,sgmllib,os 4 5 #根据当前的url获取html 6 def getHtml(url): 7 page = urllib.urlopen(url) 8 ...
分类:
其他好文 时间:
2015-11-13 18:38:49
阅读次数:
343
1 __author__ = 'minmin' 2 #coding:utf-8 3 import re,urllib,sgmllib 4 5 #根据当前的主页url获取html 6 def getHtml(url): 7 page = urllib.urlopen(url) 8 ...
分类:
其他好文 时间:
2015-11-13 18:24:10
阅读次数:
246
本内容基于Windows环境)一、已安装有Sublime Text3二、安装Package Control 安装这个后,可以在线安装所需的插件 方法1、Ctrl+~打开控制台,在控制台输入如下的Python命令import urllib.request,os;pf='Package Control....
分类:
其他好文 时间:
2015-11-12 11:13:53
阅读次数:
261
‘‘‘Createdon2013-4-3@author:zdh‘‘‘#!/usr/bin/envpython#-*-coding:utf-8-*-importreimporturllibdefmain():die={‘d‘:‘0‘,‘c‘:‘1‘,‘k‘:‘2‘,‘z‘:‘3‘,‘m‘:‘4‘,‘b‘:‘5‘,‘w‘:‘6‘,‘i‘:‘7‘,‘r‘:‘8‘,‘l‘:‘9‘}headers=(‘User-Agent‘,‘Mozilla/5.0(WindowsNT5.1;rv:14.0)Gecko/2010010..
分类:
Web程序 时间:
2015-11-10 01:55:31
阅读次数:
369