Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import requests
- url = 'https://www.youtube.com'
- headers = {
- "Connection": "keep-alive",
- "User-Agent": "Mozilla/5.0",
- "Accept": "image/jpg,image/*,*/*",
- "Accept-Encoding": "gzip,deflate,br",
- "Accept-Language": "en-US,en"
- }
- response = requests.get(url, headers=headers)
- print("-----response-----")
- print(url)
- print(response.status_code)
- print(response.elapsed)
- headers = list(response.headers)
- print("\n-----headers-----")
- list.sort(headers)
- for header in headers:
- print(header, response.headers[header])
- print("\n-----cookies-----")
- cookies = response.cookies
- for cookie in cookies:
- print(cookie)
Add Comment
Please, Sign In to add comment