随笔分类 -  Python 学习

摘要:import osimport xlrdimport xlwtimport reimport datetime#excel 表头数据table_header=['序号', '店面名称', '轮次', '总分平均分', '得分率平均分', '总分', '总体得分率', '检查日期', '进店时间', 阅读全文
posted @ 2017-12-12 12:06 沧海一粒水 阅读(182) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*-import scrapyimport urllib.requestimport reimport randomfrom jdgoods.items import JdgoodsItemfrom lxml import etreefrom scrapy. 阅读全文
posted @ 2017-12-10 23:28 沧海一粒水 阅读(198) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*-import scrapyfrom scrapy.http import Request,FormRequestimport urllib.requestclass DbSpider(scrapy.Spider): name = 'db' allowed 阅读全文
posted @ 2017-12-08 08:24 沧海一粒水 阅读(279) 评论(0) 推荐(0)
摘要:matplotlib 绘图颜色和样式 阅读全文
posted @ 2017-12-05 08:38 沧海一粒水 阅读(160) 评论(0) 推荐(0)
摘要:import scrapyfrom scrapy.http import Request,FormRequestclass TySpider(scrapy.Spider): name = 'ty' allowed_domains = ['iqianyue.com'] #start_urls = [' 阅读全文
posted @ 2017-12-02 08:23 沧海一粒水 阅读(294) 评论(0) 推荐(0)
摘要:from pptx import Presentationfrom pptx.util import Ptfrom docx.shared import Inchesprs=Presentation() slide=prs.slides.add_slide(prs.slide_layouts[1]) 阅读全文
posted @ 2017-11-29 21:11 沧海一粒水 阅读(1532) 评论(0) 推荐(0)
摘要:items.py 数据条目 import scrapy 阅读全文
posted @ 2017-11-26 15:26 沧海一粒水 阅读(1255) 评论(0) 推荐(0)
摘要:import relst = ['http://img3m9.ddimg.cn/53/33/1354578839-1_x.jpg', 'http://img3m9.ddimg.cn/63/34/1354579839-1_x.jpg', 'http://img3m9.ddimg.cn/70/31/13 阅读全文
posted @ 2017-11-25 22:23 沧海一粒水 阅读(168) 评论(0) 推荐(0)
摘要:import urllib.requestimport reimport randomimport urllib.erroruapools=[ 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)', 'Mozilla/5.0 (Win 阅读全文
posted @ 2017-11-24 08:44 沧海一粒水 阅读(254) 评论(0) 推荐(0)
摘要:import urllib.requestimport reimport randomimport urllib.erroruapools=[ 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)', 'Mozilla/5.0 (Win 阅读全文
posted @ 2017-11-23 20:36 沧海一粒水 阅读(698) 评论(0) 推荐(0)
摘要:import urllib.requestimport reimport randomimport urllib.erroruapools=[ 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)', 'Mozilla/5.0 (Win 阅读全文
posted @ 2017-11-23 20:26 沧海一粒水 阅读(154) 评论(0) 推荐(0)
摘要:import urllib.requestdef ip(): thisip=urllib.request.urlopen('http://tvp.daxiangdaili.com/ip/?tid=559796713225033&num=1&foreign=only').read().decode() 阅读全文
posted @ 2017-11-23 08:54 沧海一粒水 阅读(142) 评论(0) 推荐(0)
摘要:import randomimport urllib.requestippools=[ "39.104.50.71:8080", "39.104.50.160:8080", "39.104.14.202:8080", "39.104.50.137:8080", "39.104.50.29:8080" 阅读全文
posted @ 2017-11-22 22:20 沧海一粒水 阅读(125) 评论(0) 推荐(0)
摘要:import reimport urllib.requestimport randomfrom docx import Documentdocument = Document()document.add_heading('糗事百科',1)uapools=[ 'Mozilla/4.0 (compati 阅读全文
posted @ 2017-11-22 19:30 沧海一粒水 阅读(217) 评论(0) 推荐(0)
摘要:import reimport urllib.requestfrom docx import Documentheader=("User-Agent",'User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML 阅读全文
posted @ 2017-11-21 22:19 沧海一粒水 阅读(166) 评论(0) 推荐(0)
摘要:import reimport urllib.requestimport urllib.errorurl="http://blog.csdn.net"header=("User-Agent",'User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883... 阅读全文
posted @ 2017-11-21 18:10 沧海一粒水 阅读(359) 评论(0) 推荐(0)
摘要:import urllib.requesturl="http://blog.csdn.net"header=("User-Agent",'User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like G 阅读全文
posted @ 2017-11-20 21:43 沧海一粒水 阅读(152) 评论(0) 推荐(0)
摘要:import urllib.requestimport urllib.errortry: data =urllib.request.urlopen("http://blog.csdn.net").read() print(data.decode())except urllib.error.URLEr 阅读全文
posted @ 2017-11-20 21:42 沧海一粒水 阅读(155) 评论(0) 推荐(0)
摘要:import urllib.requestimport reimport xlwtdata=urllib.request.urlopen("https://read.douban.com/provider/all").read().decode()pat='[\u4e00-\u9fa5].*?'new_data=re.compile(pat).findall(data)book=xlwt.Work... 阅读全文
posted @ 2017-11-17 08:26 沧海一粒水 阅读(198) 评论(0) 推荐(0)
摘要:import sqlalchemyfrom sqlalchemy import create_engine,ForeignKeyfrom sqlalchemy import Column,Integer,String,Date,Enumfrom sqlalchemy.ext.declarative 阅读全文
posted @ 2017-11-10 09:22 沧海一粒水 阅读(203) 评论(0) 推荐(0)