larken

勤奋的人生才有价值

导航

2019年3月23日 #

urllib — URL handling modules

摘要: urllib is a package that collects several modules for working with URLs: •urllib.request for opening and reading URLs •urllib.error containing the exceptions raised by urllib.request ... 阅读全文

posted @ 2019-03-23 23:02 larken 阅读(99) 评论(0) 推荐(0) 编辑

111

摘要: 1 import urllib.request 2 response=urllib.request.urlopen('https://movie.douban.com/',None,2) 3 html=response.read().decode('utf-8') 4 f=open('html.html','w',encoding='utf-8') 5 f.write(html) 6 f.clo... 阅读全文

posted @ 2019-03-23 22:48 larken 阅读(72) 评论(0) 推荐(0) 编辑

python code(1)

摘要: 1 from collections import UserList 2 class MthChianList(UserList): 3 def filter(self,predicste): 4 return MthChianList(elem for elem in self if predicste(elem)) 5 def map(self,ma... 阅读全文

posted @ 2019-03-23 19:29 larken 阅读(157) 评论(0) 推荐(0) 编辑