ajax请求下
form urllib.request import Request urlopen
form fack_useragent import UserAgent
base_url = “https://www.bilibili.com/video/BV1QS4y1D7H9?p=8”
i = 0
while Ture:
headers = {
“User-Agent”:User-Agent().chrome
}
url = base_url.format(i * 20)
request = Request(url , headers=headers)
response = urlopen(request)
info = response.code().decode()
print(info)
if info == “” or info is None:
break
i++