xiaoxinx123 发表于 2024-4-6 23:21

python练习

import requests

url = 'https://movie.douban.com/chart'
# /html/body/div/div/div/div/div/div/table/tbody/tr/td/div/a
# /html/body/div/div/div/div/div/div/table/tbody/tr/td/div/a
headers = {

    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36',
    'cokie': 'll="118171"; bid=qrYAfqMrKrQ; _pk_id.100001.4cf6=31c9158a1b946ac2.1711810321.; _vwo_uuid_v2=D3965356AE5B33FD47C596E9A33BAE347|9294441ac74ca0968a8de6178fe8821e; __yadk_uid=aad9k0tbeKp00oVrmB7VgXdcIWfSkQQb; __gads=ID=60e9fa63a4a532b8:T=1711810325:RT=1711810325:S=ALNI_Mb0UaL9-BqXqwK0E97M-8Cqoilk9A; __gpi=UID=00000d785356ee82:T=1711810325:RT=1711810325:S=ALNI_MaQY2pFWHuxzRxUQeL40gd0PU2fig; __eoi=ID=d3639b1f7f2b0713:T=1711810325:RT=1711810325:S=AA-AfjbIyf-HvG4Nl4kDYH8Nc1eX; __utma=30149280.685499722.1711810321.1711810321.1711896187.2; __utmc=30149280; __utmz=30149280.1711896187.2.2.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmt=1; __utmb=30149280.2.10.1711896187; __utma=223695111.1713220842.1711810321.1711810321.1711896227.2; __utmb=223695111.0.10.1711896227; __utmc=223695111; __utmz=223695111.1711896227.2.2.utmcsr=douban.com|utmccn=(referral)|utmcmd=referral|utmcct=/; _pk_ref.100001.4cf6=%5B%22%22%2C%22%22%2C1711896227%2C%22https%3A%2F%2Fwww.douban.com%2F%22%5D; _pk_ses.100001.4cf6=1; ap_v=0,6.0'

}
r = requests.get(url)

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

print(r.text)

cxx0515 发表于 2024-4-7 07:22

学习了,我现在碰到一个问题,必须在指定软件内打开,企业微信分享的企业微信网盘文件,不会爬了

xiaoxinx123 发表于 2024-4-7 09:29

cxx0515 发表于 2024-4-7 07:22
学习了,我现在碰到一个问题,必须在指定软件内打开,企业微信分享的企业微信网盘文件,不会爬了

先学其他的等浏览器的会了在学软件

yubuguosan 发表于 2024-4-7 10:42

你这个头部确实长

coder126 发表于 2024-4-7 10:48

requests还是很强大

hdxzd12 发表于 2024-4-7 12:26

你将cookie拼写为了"cokie",而不是"cookie"。

yonker6664 发表于 2024-4-7 12:41

谢谢分享,DDDDDDDDDDDDDDD!!!!!!!!!!!!
页: [1]
查看完整版本: python练习