折腾:
【未解决】自动化搜索和提取安卓游戏网站game.vivo.com.cn中游戏信息列表
期间,需要去获取
去Chrome中分析就是:

此处去试试代码实现
python requests 302
设置allow_redirects为false?即可?
去看看resp.history
感觉还是:不让跳转 更好?
r = requests.get('http://github.com/', allow_redirects=False)
去试试
def get302RealUrl(originUrl): realUrl = "" resp = requests.get(originUrl, allow_redirects=False) if resp.status_code == 302: realUrl = resp.headers['Location'] return realUrl
即可:

然后提取到库中:
import requests def get302RealUrl(originUrl): """get real url address after 302 move Args: originUrl (str): original url Returns: real url(str) Raises: Examples: input: 'http://dl.gamecenter.vivo.com.cn/clientRequest/gameDownload?id=57587&pkgName=com.jiuzun.mxsg.vivo&sourword=%E4%B8%89%E5%9B%BD&page_index=4&dlpos=1&channel=h5' output: 'https://gameapktxdl.vivo.com.cn/appstore/developer/soft/20180206/201802061851104837232.apk' """ realUrl = "" resp = requests.get(originUrl, allow_redirects=False) if resp.status_code == 302: realUrl = resp.headers['Location'] return realUrl
详见: