
用pytho写网络爬虫
一个没有姓名的咸鱼
Github:https://github.com/LelandYan
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
TypeError: can't concat str to bytes
def download(url, user_agent='wswp', num_retries=2): print("Downloading: " + url) headers = {'User-agent': user_agent} req = request.Request(url, headers) try: html = request.u...原创 2018-09-22 11:17:47 · 10161 阅读 · 3 评论 -
用python获取大学生数学竞赛题目的方法
##用python获取大学生数学竞赛题目的方法 ###所用模块 requests BeautiSoup os ####思路很简单就是request获取,然后BeautiSoup解析,获取image的url,写入文件即可 import requests from bs4 import BeautifulSoup import os def getImages(url, path): ...原创 2018-09-22 15:12:55 · 622 阅读 · 0 评论