用requests爬虫拒绝301/302页面的重定向而拿到Location(重定向页面URL)的方法

def yunsite():
    'url'
    headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
               'Accept-Encoding': 'gzip, deflate, sdch, br',
               'Accept-Language': 'zh-CN,zh;q=0.8',
               'Connection': 'keep-alive',
               'Host': 'pan.baidu.com',
               'Upgrade-Insecure-Requests': '1',
            

你可能感兴趣的:(python爬虫笔记)