Fetch the repository succeeded.
This action will force synchronization from 耿直的小爬虫/Python爬虫, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
import requests
from pyquery import PyQuery as pq
url='https://box.maoyan.com/promovie/api/box/second.json'
headers={
'user-agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X MetaSr 1.0'
}
response=requests.get(url,headers=headers)
if response.status_code==200:
test=response.json()
else:
print('不是200')
if test:
items=test.get('data').get('list')
#print(items)
for item in items:
#print(items)
shuju={}
shuju['片名']=item.get('movieName')
shuju['上映天数']=item.get('releaseInfo')
shuju['综合票房']=item.get('boxInfo')
shuju['收入票房']=item.get('sumBoxInfo')
shuju['票房占比']=item.get('showRate')
shuju['上座率']=item.get('avgSeatView')
shuju['场均人次']=item.get('avgShowView')
print(shuju)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。