自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 资源 (3)
  • 收藏
  • 关注

原创 linux管理文件和目录的命令

linux&&linux||linux管理文件、目录

2016-08-31 15:30:03 377

原创 python两个list转dict

In[53]: a=[1,2,3]In[54]: b=[4,5,6]In[55]: c=zip(a,b)In[57]: d={i:j for i,j in c}In[58]: dOut[58]: {1: 4, 2: 5, 3: 6}

2016-08-26 16:45:45 1330

原创 python爬去搜狐论坛笔记

今天搞了半天才搞定搜狐的爬虫,坑还蛮多的。特意记下来,方便自己下次捡起来。首先是搜狐论坛每个板块的url不一样,不能直接在得到的  【a/@href  】 加前缀。后来找到了介个,我用的是python的scrapy框架,搜狐的论坛上,每一层楼的数据是用get的方式得到的,所以response.xpath('//table[@class="viewpost"]').ext

2016-08-26 16:30:50 792

原创 python的url编码

import urlliburllib.quote('清远')Out[143]: '%E6%B8%85%E8%BF%9C'

2016-08-23 16:13:35 268

原创 python的strip('')函数带参数

In[45]: xOut[45]: '   ----fdaf-dafdfa-  'In[46]: x.strip(' ')Out[46]: '----fdaf-dafdfa-'

2016-08-22 10:32:12 1352

原创 w3lib.html remove_tags()函数 去除html的tags

from w3lib.html import remove_tags#去除html的标签,可用于爬虫处理htmlIn[32]: remove_tags(u'1000')Out[32]: u'1000'In[33]: remove_tags(u'€')Out[33]: u'€'In[34]: remove_tags(

2016-08-22 09:46:11 3707

原创 python str的函数isdigit()

value = u"1" value.isdigit() num = b"1" # bytenum.isdigit() num = "IV" num.isdigit() num = "四"num.isdigit()

2016-08-22 09:32:20 1441

原创 scrapy crawl xxx 利用scrapy.shell.inspect_response 输出爬虫运行信息

在scrapy框架中利用inspect_response在cmd上进入shellimport scrapyfrom scrapy.shell import inspect_responseclass MySpider(scrapy.Spider): name = "example" start_urls = [ "http://example.org"

2016-08-18 16:56:29 1867

原创 python在cmd上传参,用于写接口

#-*-encoding=utf-8-*-import sysprint u'有:', len(sys.argv),u'参数.'print u'参数类型type(sys.argv):',type(sys.argv)print u'参数:sys.argv ',sys.argvprint u'参数:str(sys.argv) ', str(sys.argv)pri

2016-08-18 15:55:07 858

原创 json.loads 把str转换为json

爬虫常用函数 json.loads()In[44]: jsonStrOut[44]: u'{"retcode":"0","uid":"12312312","nick":"\\u60xx\\u60xx\\u806xx","crossDomainUrlList":["https:\\/\\/passport.weibo.com\\/wbsso\\/login?","https:

2016-08-12 11:04:49 957

原创 python 时间戳与时间之间的转换

time_list = {u"昨天":time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(time.time()-60*60*24)),                     u"前天":time.strftime("%Y-%m-%d %H:%M:%S",time.localtime(time.time()-60*60*24*2)),   

2016-08-09 16:33:44 1597

mysqlclient-1.3.12-cp27-cp27m-win_amd64.whl

python安装mysqlclient的安装包,适合python2.7,下载下来pip install 文件名就可以了

2018-02-07

pywin32-220.win-amd64-py3.4

pywin32-220.win-amd64-py3.4

2016-10-18

js实现第一人称射击游戏

js实现第一人称射击游戏

2016-03-20

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除