web crawler - Sending "User-agent" using Requests library in Python - Stack Overflow

PHOTO EMBED

Fri Aug 26 2022 16:13:35 GMT+0000 (Coordinated Universal Time)

Saved by @TruxRipper #python

import requests

url = 'SOME URL'

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

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

https://stackoverflow.com/questions/10606133/sending-user-agent-using-requests-library-in-python