码迷,mamicode.com
首页 >  
搜索关键字:urllib    ( 2222个结果
Python爬虫_用Python爬取csdn页面信息目录
1.原理: 这个程序可以实现批量获取到某一个CSDN博客的个人信息、目录与链接的对应,并存到一个本目录的mulu.txt文件中 2.具体代码: # -*- coding: cp936 -*- import urllib.request# import re# import sys# import time# import random import string headers = {#...
分类:编程语言   时间:2015-05-19 10:44:32    阅读次数:156
python 爬虫爬取腾讯新闻科技类的企鹅智酷系列(1)
废话不多说,直接贴代码,主要采用BeautifulSoup写的 # -*- coding: utf-8 -*- """ Created on Mon May 18 19:12:06 2015 @author: Administrator """ import urllib import os from bs4 import BeautifulSoup impo...
分类:编程语言   时间:2015-05-19 10:44:07    阅读次数:145
PHP处理来自Python的Post的json数据
最近用Python处理了一些json数据,但在过程中遇到一些问题,遂记录之。 1.Python Post json格式数据至服务器: 查阅了一些资料,大多是这么样的: __author__ = 'jiezhi' import urllib import urllib2 data = {'name': 'jiezhi', 'age': '24'} ret = u...
分类:编程语言   时间:2015-05-18 12:55:56    阅读次数:193
前端与php的sublime text3常用插件
1、安装Package Control 快捷键:ctrl+` 粘贴内容后Enter:import urllib.request,os,hashlib; h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d...
分类:Web程序   时间:2015-05-17 18:31:21    阅读次数:232
python写的的简单的爬虫小程序
import reimport urllibdef getHtml(url):page=urllib.urlopen(url)html=page.read()return htmldef getpic(html):s=r'src="(.*?\.jpg)" pic_ext'piclist=re.fin...
分类:编程语言   时间:2015-05-17 18:28:38    阅读次数:149
爬虫学习---美丽汤
#coding:utf-8#version: 0.1#note:实现了查找0daydown最新发布的10页资源。import urllib.requestfrom bs4 import BeautifulSoupfor i in range(1,11): url = "http://www.0day...
分类:其他好文   时间:2015-05-16 14:42:12    阅读次数:130
爬虫学习--使用百度api---天气
#coding:utf-8#version:0.1#note:该即用API能查询指定城市的空气质量指数,但城市数量有限,截止2015年3月26日,只能查到全国161个城市的。import urllib.requestimport jsonimport collectionsimport urllib...
分类:Windows程序   时间:2015-05-16 13:23:30    阅读次数:727
#python爬虫:爬取糗事百科段子
#出处:http://python.jobbole.com/81351/#确定url并抓取页面代码,url自己写一个import urllib,urllib2def getUrl(): page=1 url="http://www.qiushibaike.com/hot/page/"+s...
分类:编程语言   时间:2015-05-16 00:00:01    阅读次数:370
爬虫学习 一些有用的函数吧
1.geturl---- 获取真实的urlfrom urllib.request import Request, urlopenfrom urllib.error import URLError, HTTPError old_url = 'http://rrurl.cn/b1UZuP' req...
分类:其他好文   时间:2015-05-14 20:21:01    阅读次数:141
爬虫学习----获取cookie
http://blog.csdn.net/samxx8/article/details/215359011.获取cookieimport urllib import http.cookiejarcookie = http.cookiejar.CookieJar()opener = urllib.re...
分类:其他好文   时间:2015-05-14 20:16:52    阅读次数:117
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!