python
高度之巅
苦逼一个
展开
-
python 页面读取
import urllib.requestfp=urllib.request.urlopen("http://127.0.0.1:8080/secure/Dashboard.jspa")mybens=fp.read();mystr=mybens.decode("utf-8")fp.close()print(mystr)原创 2014-04-15 12:51:17 · 589 阅读 · 0 评论 -
Windows 安装BeautifulSoup4.3.2模块的安装
python BeautifulSoup模块的安装 ···一个BeautifulSoup的模块,安装就浪费了俺这么长时间,下载的是BeautifulSoup4-4.1.3, 安装的时候就是 python setup.py build python setup.py install 就这么简单的两个命令,因为安装之前也原创 2014-04-21 10:32:59 · 1783 阅读 · 0 评论 -
xlrd and xlwt 读写
import xlrd import xlwt data=xlrd.open_workbook('info.xls','r') table=data.sheets()[0] list=[] nrows=table.nrows for i in range(nrows): print(table.cell(i,0).value) list.append(table.c原创 2014-05-06 22:41:26 · 456 阅读 · 0 评论 -
Python 抓取网页特定信息
from sgmllib import SGMLParser import urllib class myparser(SGMLParser): def __init__(self): SGMLParser.__init__(self) self.is_person_attr_name=0 self.is_person_attr_原创 2014-04-25 13:41:46 · 1024 阅读 · 0 评论 -
使用代理抓取网页数据
# -*- coding: cp936 -*- import urllib class search: def fetch_data(self): proxies={'http':'http://135.245.115.235:80'} opener = urllib.FancyURLopener(proxies) urldata=opene原创 2014-05-29 15:35:56 · 784 阅读 · 0 评论