摘要: 安装:‘以管理员身份运行’cmd 执行pip install beautifulsoup4 Beautiful Soup库的理解: 解析、遍历、维护标签树的功能库 那么何为标签树? 1 from bs4 import BeautifulSoup 2 import requests 3 r=reque 阅读全文
posted @ 2023-02-25 13:58 小小派下士 阅读(60) 评论(0) 推荐(0) 编辑
摘要: 网络图片链接的格式: http://www.example.com/picture.jpg http://img0.dili360.com/ga/M00/34/5E/wKgBzFS8cISAYYg5AB5r1Gar-oQ103.tub.jpg 1 import requests 2 import o 阅读全文
posted @ 2023-02-24 18:27 小小派下士 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 仍然利用Requests库来实现 1 import requests 2 r=requests.get('https://www.amazon.cn/gp/product/B01M8L5Z3Y') 3 r.status_code 4 r.encoding=r.apparent_encoding 5 阅读全文
posted @ 2023-02-24 17:39 小小派下士 阅读(106) 评论(0) 推荐(0) 编辑
摘要: win+R输入cmd再执行 pip install requests import requests r=requests.get('https://www.baidu.com/') print(r.status_code)#状态码,200表示正常 r.text#url对应的页面内容,为字符串形式r 阅读全文
posted @ 2023-02-24 16:21 小小派下士 阅读(14) 评论(0) 推荐(0) 编辑