简单的爬虫(定向爬图片)
这次定向爬取的网站是
http://616pic.com/png/?sem=7&sem_kid=27&ks=4941
上面的图片
爬虫码如下
# _*_coding:utf-8_*_
from bs4 import BeautifulSoup
import urllib.request
import requests
header = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)\
Chrome/67.0.3396.62 Safari/537.36'}
url = r"http://616pic.com/png/?sem=7&sem_kid=27&ks=4941"
req