import requests
response = requests. get( 'https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js' )
response. encoding = 'utf-8'
print ( response. json( ) )
for x in response. json( ) [ 'hero' ] :
print ( x[ 'name' ] )
import requests
headers = {
'cookie' : 'll="118318"; bid=9PCotzAzm6s; __utmz=30149280.1679901736.1.1.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmz=223695111.1679901746.1.1.utmcsr=douban.com|utmccn=(referral)|utmcmd=referral|utmcct=/; __yadk_uid=17PiqIQZCuHgEqZYfw0iItEbWdW1yYjw; _vwo_uuid_v2=DCA5DA4B64D00C6B85B51EBF756646BA8|45d190edb8ec80f228ee42ebc7abe831; douban-fav-remind=1; __gads=ID=3ea5a58d70242dbd-224c59b1bbdc00a9:T=1679902713:RT=1679902713:S=ALNI_MYAT2NT52wZr92BznytIkZRbBRmzw; __gpi=UID=00000be2064f0a1f:T=1679902713:RT=1679902713:S=ALNI_MYlesALcolat48_hzoEsXEj8IlqFw; _pk_ref.100001.4cf6=%5B%22%22%2C%22%22%2C1679909423%2C%22https%3A%2F%2Fwww.douban.com%2F%22%5D; _pk_id.100001.4cf6=7e6559da01217d8b.1679901746.2.1679909423.1679902916.; _pk_ses.100001.4cf6=*; ap_v=0,6.0; __utma=30149280.1729659530.1679901736.1679901736.1679909424.2; __utmb=30149280.0.10.1679909424; __utmc=30149280; __utma=223695111.1817846298.1679901746.1679901746.1679909424.2; __utmb=223695111.0.10.1679909424; __utmc=223695111' ,
'user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36'
}
response = requests. get( 'https://movie.douban.com/top250 ' , headers= headers)
result = response. text
print ( result)
import requests
response = requests. get( 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Ff2047f83-314f-4bef-972e-672221354ac5%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1682496624&t=4c3c5031e6708d751a9a17460bdea2ad' )
result = response. content
print ( type ( result) )
with open ( 'files/a.jpg' , 'wb' ) as f:
f. write( result)
import requests
response = requests. get( 'https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js' )
for x in response. json( ) [ 'hero' ] :
print ( x[ 'heroId' ] )