码迷,mamicode.com
首页 >  
搜索关键字:urllib    ( 2222个结果
网络爬虫之爬一爬2008奥运会的赛事结果
先决条件:Python环境然后装了下模块Beautifulsoup4,lxml,requests笔者当然推荐Anaconda了,在此基础上pip或者conda安装就行如,C:\>condainstalllxmlbeautifulsoup4requests其实爬下来倒不是很难,不管是requests还是urllib,一下就能把页面download下来,在抓下来之后的..
分类:其他好文   时间:2015-11-19 19:12:25    阅读次数:422
Python网络爬虫 - 下载图片
下载博客园的logofrom urllib.request import urlretrievefrom urllib.request import urlopenfrom bs4 import BeautifulSouphtml = urlopen("http://www.cnblogs.com"...
分类:编程语言   时间:2015-11-19 12:38:18    阅读次数:165
Python获得所有上证公司列表
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)①爬取中国新闻网科技相关部分新闻
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)②爬取光明网部分旅游新闻
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)④爬取新浪军事新闻,并把内容存放到相应的文件夹中
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)⑥爬取腾讯经济相关的部分新闻
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
sublime text3 增加emmett插件
本内容基于Windows环境)一、已安装有Sublime Text3二、安装Package Control 安装这个后,可以在线安装所需的插件 方法1、Ctrl+~打开控制台,在控制台输入如下的Python命令import urllib.request,os;pf='Package Control....
分类:其他好文   时间:2015-11-12 11:13:53    阅读次数:261
从烈火网下载HTTP代理de例子
‘‘‘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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!