欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

cookies

程序员文章站 2024-03-20 13:34:28
...
import requests

headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36'}
cookies = {'cookie': '....'}
url = '...'
r = requests.get(url, cookies = cookies, headers = headers)
with open('2.txt', 'wb+') as f:
    f.write(r.content)