![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python记录
ZhengPuti
要把问题想透,要不停的想,不停的琢磨,一刻都不能停
展开
-
python实现自动登录
最近大数据感兴趣实践了一下自动登录,返回结果是登录成功 import urllib import urllib2 import gzip import StringIO #构建post请求的字典 postvalues={"username":"xxxxx","password":"xxxxx","formhash":"xxxxx","referer":"xxxxxx","questi原创 2016-11-09 10:25:57 · 1049 阅读 · 0 评论 -
python返回cookie
cookie = cookielib.CookieJar() handler=urllib2.HTTPCookieProcessor(cookie) opener = urllib2.build_opener(handler) response = opener.open(request) for item in cookie: print 'Name = '+item.name原创 2016-11-09 17:50:31 · 409 阅读 · 0 评论 -
pathon 抓取百科实践
今天对照学习了爬虫的面向对象编程,源程序有一定的问题,修改之后可以运行了, 贴出的源码中隐藏了对源网站的抓取 # -*- coding:utf-8 -*- #to avoid the encoded issue __author__="JIE" import urllib import urllib2 import re import thread import time class原创 2016-11-10 19:36:34 · 271 阅读 · 0 评论 -
python抓取初步尝试
pattern用了示例中例子,发现有些不对,自己修改了一下pattern import urllib import urllib2 import re page =1 url = "http://www.qiushibaike.com/hot/page/"+str(page) user_agent='Mozilla/4.0 (compatible; MSIE 5.5; Windows原创 2016-11-10 16:17:00 · 200 阅读 · 0 评论 -
python 数据处理初试记录
实验网址是聚宽量化网址 security = '600172.XSHG' rawData = attribute_history(security, 5, unit='1d', fields=('close','high','low','volume'), skip_paused=True) middlevalue=[] for i in range(len(rawData ['high原创 2016-11-17 11:05:28 · 320 阅读 · 0 评论 -
Pytho量化初试
python 做量化的初步尝试,对数据类型还是有点儿不熟,不过有参考策略看真是不错 #计算peg的思路 df_Growth_PE_G = df_PE_G[(df_PE_G.pe_ratio > 0) & (df_PE_G.inc_net_profit_year_on_year > 0)] df_Growth_PE_G.dropna() #dataframe转series Series_P转载 2016-11-15 17:58:32 · 314 阅读 · 0 评论