#获取视频地址 # 每次请求一次,然后写文件,这样可以规避多次请求触发反爬虫 r = requests.get('https://www.pearvideo.com/video_1522192') html = r.content.decode("utf-8") print(html) with open("./test.html","w") as f: f.write(html.encode("gbk","igno…
用python黑框运行程序写入文件时闪退,或一行行运行到写入时提示8170数字. 经试验,为文件路径错误导致. with open("1.doc", "wb") as file: file.write(response.read()) 改为: with open("C:\\Users\\用户名\\Desktop\\1.doc", "wb") as file: file.write(response.read()) 写入文件即可…
当我在linux下用vi打开p1.c文件时 root@iZ2zeeailqvwws5dcuivdbZ:~/1/01/指针# vi p1.c 会出现如下信息: E325: ATTENTION Found a swap file by the name ".p1.c.swp" owned by: root dated: Fri Jan :: file name: ~root///指针/p1.c modified: YES user name: root host name: iZ2zeea…
# 每次请求一次,然后写文件,这样可以规避多次请求触发反爬虫 r = requests.get('https://www.pearvideo.com/video_1522192') html = r.content.decode("utf-8") print(html) with open("./test.html","w") as f: f.write(html.encode("gbk","ignore"…