python 3 网络爬取图片之二

2017-01-12 19:09:03来源:CSDN作者:qq_15627543人点击

第七城市
import webbrowser, requests, bs4, re, osurl = "https://www.sogou.com"res = requests.get(url)soup = bs4.BeautifulSoup(res.text, "html.parser")img = soup.select('img')comicUrl = img[0].get('src')imageFile = open(os.path.join('c://u', os.path.basename(comicUrl)), 'wb')res1 = requests.get(url+comicUrl)for chunk in res.iter_content(100000):    imageFile.write(chunk)imageFile.close()

第七城市

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台