python
文章平均质量分 61
feinxer
这个作者很懒,什么都没留下…
展开
-
(初学)requests库爬取bt蚂蚁资源
import requestsimport redef getHTMLtext(url): try: r = requests.get(url, timeout=30) r.raise_for_status() r.encoding = r.apparent_encoding return r.text except: print("cannot scrapy the原创 2017-09-16 14:07:39 · 3697 阅读 · 0 评论 -
(初学)requests批量爬取搜狗图片
import requestsimport reimport osdef getHTMLtext(url): headers = {'user-agent':'Mozilla/5.0'} try: r = requests.get(url, timeout=30, headers=headers) r.raise_for_status() r.encoding = r.ap原创 2017-09-16 20:53:27 · 2535 阅读 · 1 评论