import webbrowser, requests, bs4, re, os
url = "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()
python 3 网络爬取图片之二
最新推荐文章于 2023-03-26 09:12:19 发布