Home > other >  Python spiders crawl embarrassing figure picture there is an error
Python spiders crawl embarrassing figure picture there is an error

Time:10-03

 


Why do you write programs, not climbing out the picture, but the
Source code has been given, bosses, please have a look at
The import re
The import requests
Url='https://www.qiushibaike.com/imgrank/'
Headers={
'the user-agent' : 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36 '
}
Pagr_text=requests. Get (url=url, headers=headers). The text
The ex='& lt; Div & gt; . *? SRC=https://bbs.csdn.net/topics/re.findall (ex, page_text, re S)

For the new in SRC:
New_url='HTTPS:' + new + url
Tupian=requests. Get (=new_url url, headers=headers). The content
With the open ('/tuku ', 'wb) as fp:
Fp. Write (tupian)
Print (' complete ')
  • Related