摘要: https://www.linuxidc.com/Linux/2016-02/128127.htm 阅读全文
posted @ 2018-03-10 23:57 jonm 阅读(236) 评论(0) 推荐(0) 编辑
摘要: datetime模块用于是date和time模块的合集,datetime有两个常量,MAXYEAR和MINYEAR,分别是9999和1. datetime模块定义了5个类,分别是 1.datetime.date:表示日期的类 2.datetime.datetime:表示日期时间的类 3.dateti 阅读全文
posted @ 2018-02-26 20:38 jonm 阅读(870) 评论(0) 推荐(0) 编辑
摘要: 1. 用一行输出所有大(小)写字母,以及数字 2. 列表生成式 3. 生成随机验证码 阅读全文
posted @ 2018-02-14 11:55 jonm 阅读(17821) 评论(0) 推荐(1) 编辑
摘要: 1 import scrapy 2 import sys 3 # import io 4 # sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='gb18303') 5 from scrapy.selector import Selector, HtmlXPathSelector 6 class ChoutiSpide... 阅读全文
posted @ 2018-02-01 13:13 jonm 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 1 # 上行遍历 2 soup = BeautifulSoup(demo, 'html.parser') 3 for parent in soup.a.parents: 4 if parent is None: 5 print(parent) 6 else: 7 print(parent.name) 阅读全文
posted @ 2018-01-27 15:15 jonm 阅读(170) 评论(0) 推荐(0) 编辑
摘要: # 保存文件(文本,图片,视频...) 1 def save_file(): 2 url = 'http://css.8684.cn/citys/images/line/45.jpg' 3 root = r'd:/pics/' 4 path = root + url.split('/')[-1] 5 try: 6 if not os.p... 阅读全文
posted @ 2018-01-27 00:24 jonm 阅读(180) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/linzch3/article/details/60750355 阅读全文
posted @ 2018-01-25 22:53 jonm 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 大学排名练习 淘宝商品比价: 股票数据: 阅读全文
posted @ 2018-01-25 21:28 jonm 阅读(584) 评论(0) 推荐(0) 编辑
摘要: 待完善....... 阅读全文
posted @ 2018-01-25 16:08 jonm 阅读(564) 评论(0) 推荐(0) 编辑
摘要: 1 import re 2 import hashlib 3 import json 4 5 def get_md5(pwd): # md5加密 6 m = hashlib.md5() 7 m.update(pwd.encode('utf-8')) 8 return m.hexdigest() 9 10 def get_name_md5():... 阅读全文
posted @ 2018-01-21 01:37 jonm 阅读(282) 评论(0) 推荐(0) 编辑