随笔分类 -  爬虫

摘要:request中文API https://requests.readthedocs.io/zh_CN/latest/ 阅读全文
posted @ 2020-07-04 21:28 SunCY 阅读(288) 评论(0) 推荐(0)
摘要:登陆的方式 1.实例化session,使用session发送post请求,在使用它获取登陆后的页面 # coding=utf-8 import requests session = requests.session() post_url = "http://www.renren.com/PLogin 阅读全文
posted @ 2020-07-04 17:30 SunCY 阅读(797) 评论(0) 推荐(0)
摘要:找一个免费IP的网站 # coding=utf-8 import requests proxies = {"http":"http://114.234.80.188:80"}#就代理填到这里 headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Int 阅读全文
posted @ 2020-07-04 15:57 SunCY 阅读(122) 评论(0) 推荐(0)
摘要:要爬取的网站:http://fy.iciba.com/ https://blog.csdn.net/weixin_43808690/article/details/87886075 原文链接 代码: from urllib import request,parse import json class 阅读全文
posted @ 2020-07-04 14:26 SunCY 阅读(359) 评论(0) 推荐(0)
摘要:如果不改变header,往往只能获取到很少一部分的content。所以我们要改变header import requests respones = requests.get("https://www.baidu.com") print(respones.status_code) print(resp 阅读全文
posted @ 2020-07-03 11:49 SunCY 阅读(2766) 评论(0) 推荐(0)
摘要:![](https://img2020.cnblogs.com/blog/1724342/202007/1724342-20200703095548307-272193960.png)![](https://img2020.cnblogs.com/blog/1724342/202007/1724342-20200703095605740-2141259811.png)![](https://img... 阅读全文
posted @ 2020-07-03 11:44 SunCY 阅读(180) 评论(0) 推荐(0)
摘要:![](https://img2020.cnblogs.com/blog/1724342/202007/1724342-20200703100705142-144313380.png)![](https://img2020.cnblogs.com/blog/1724342/202007/1724342-20200703100943629-485341444.png)![](https://img2... 阅读全文
posted @ 2020-07-03 10:15 SunCY 阅读(106) 评论(0) 推荐(0)
摘要:GET / HTTP/1.1 Host: www . baidu . com Connection: keep- alive Cache- Control: max- age=0 Upgrade Insecure Requests: 1 User-Agent: Mozilla/5.0 (Window 阅读全文
posted @ 2020-07-03 08:54 SunCY 阅读(740) 评论(0) 推荐(0)
摘要:#HI ##HI ###HI ####HI #####HI ######HI 引用测试 加粗测试 SCY **SCY** 语言测试 阅读全文
posted @ 2020-07-03 07:11 SunCY 阅读(112) 评论(0) 推荐(0)
摘要:■HTTP ●超文本传输协议 ●默认端口号:80■HTTPS ●HTTP + SSL (安全套接字层) ●默认端口号: 443HTTPS比HTTP更安全,但是性能更低 阅读全文
posted @ 2020-07-03 06:45 SunCY 阅读(151) 评论(0) 推荐(0)
摘要:字符串的类型 ●bytes: 二进制 互联网.上数据的都是以二进制的方式传输的 ●str : unicode的呈现形式 字符(Cheracter)是各种文字和符号的总称,包括各国家文字、标点符号、图形符号、数字等 字符集(Character set)是多个字符的集合 字符集包括: ASCII字符集、 阅读全文
posted @ 2020-07-03 06:40 SunCY 阅读(159) 评论(0) 推荐(0)