#-*-coding:utf-8-*-
importurllib2
response=urllib2.urlopen(‘http://hq.sinajs.cn/list=sh601006‘)
html=response.read()
printhtml.decode("gbk")股票数据的获取目前有如下两种方法可以获取:1.http/JavaScript接口取数据2.web-service接口1.http/javascript接口取数据1.1..
分类:
编程语言 时间:
2017-08-07 17:39:59
阅读次数:
179
from bs4 import BeautifulSoup import urllib.request doc = urllib.request.urlopen('http://www.bkzy.org/Index/Declaration?intPageNo=1') doc = doc.read()... ...
分类:
Web程序 时间:
2017-08-07 13:36:46
阅读次数:
222
错误内容:UnicodeEncodeError: 'ascii' codec can't encode characters in position 28-29: ordinal not in range(128) 1.以为是代码错误,检查tab符,并没有问题, 2.将代码粘贴到空白项目中去,发现还 ...
分类:
Web程序 时间:
2017-08-06 20:39:46
阅读次数:
565
1、urlopen(url, data, timeout) 2、Request: ...
分类:
Web程序 时间:
2017-08-03 11:16:24
阅读次数:
171
urllib.request — Extensible library for opening URLs import urllib.request #网址 url = "http://www.douban.com/" #请求 request = urllib.request.Request(url ...
分类:
Web程序 时间:
2017-08-01 16:37:00
阅读次数:
225
#-*- coding:utf-8 -*- import urllib2 import re url = 'https://book.douban.com/tag/%E5%B0%8F%E8%AF%B4' request = urllib2.Request(url) urlopen = urllib2... ...
分类:
编程语言 时间:
2017-07-31 11:46:39
阅读次数:
176
from urllib.request import urlopen from bs4 import BeautifulSoup import re class doubanSpider(): def __init__(self): """ 初始化, 页码,URL,存储数据, """ self.pa... ...
分类:
编程语言 时间:
2017-07-28 19:26:58
阅读次数:
143
阅读OReilly.Web.Scraping.with.Python.2015.6笔记 Crawl 1.函数调用它自身,这样就形成了一个循环,一环套一环: 2. ...
分类:
编程语言 时间:
2017-07-28 15:35:37
阅读次数:
258
Map --映射 Reduce -- 归纳 将大数据标准化的处理 Map 拆封任务,Reduce将结果合并 这样是不是能够将很多计算机组成一台超级计算机呢? 一些问题:如果任务本身就很复杂,那么拆解任务本身就是一个很打的难题。 python 在2.6 的时候 增加了 map reduce函数 例如我 ...
分类:
编程语言 时间:
2017-07-26 01:40:00
阅读次数:
216
import urllib.request response = urllib.request.urlopen("http://www.fishc.com") html = response.read() html = html.decode("utf-8") print(html) ...
分类:
Web程序 时间:
2017-07-23 21:10:19
阅读次数:
229