#爬取王者荣耀英雄图片
#导入所需模块
import requests
import re
import os
#导入json文件(里面有所有英雄的名字及数字)
url='http://pvp.qq.com/web201605/js/herolist.json' #英雄的名字json
head={'User-Agent':'换成你自己的head'}
html = requests.get(url,headers = head)
html=requests.get(url)
html_json=html.json()
#提取英雄名字和数字
hero_name=list(map(lambda x:x['cname'],html_json)) #名字
hero_number=list(map(lambda x:x['ename'],html_json)) #数字