- 博客(2)
- 收藏
- 关注
原创 python爬取图片
for pic_url in pic_urls[0:5]: # python是左闭右开的,所以[0:5]本质上是0-4,即前5位# print(pic_url) r = requests.get(pic_url) image_name = pic_url.split('/')[-1] with open('img/%s' % image_name, 'wb')...
2019-04-01 22:43:49
148
原创 python 中 'str' object has no attribute 'content' 的报错解决
代码如下:# method1response = urlopen(url).read().decode('utf-8') #用utf-8解析soup = BeautifulSoup(response, 'lxml')print(soup.prettify())# method2, 更推荐response = requests.get(url)soup = BeautifulSoup...
2019-03-31 20:02:46
19889
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人