📜  python 请求设置用户代理 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:12.908000             🧑  作者: Mango

代码示例1
import requests

url = 'SOME URL'

headers = {
    'User-Agent': 'My User Agent 1.0',
    'From': 'youremail@domain.com'  # This is another valid field
}

response = requests.get(url, headers=headers)