requests是python实现的最简单易用的HTTP库 ,大多数时候爬虫使用requests库

import requests
import json
# requests.get()
# requests.post()
# requests库常见二种请求 post get

res = requests.get(" http://www.baidu.com")
print(res) # <Response [200]>
print(type(res)) # <class 'requests.models.Response'>
print(res.status_code) # 200


# 时间戳的生成 在线转换工具https://tool.lu/timestamp
import time
t = int(time.time()*1000)
print(t)

# 生成uuid
import uuid
sessionuuid = uuid.uuid4()
print(sessionuuid)