随笔分类 - B---python爬虫
摘要:1. 信息标记 2. 信息标记种类 2.1 XML 举例: 2.2 JSON 2.3 YAML 3. 三种信息标记形式比较
阅读全文
摘要:1. prettify() import requests from bs4 import BeautifulSoup r = requests.get("http://python123.io/ws/demo.html") demo = r.text print(demo, "\n") soup
阅读全文
摘要:1. Beautiful Soup安装 pip install beautifulsoup linux要用 pip3 2. 使用 使用这个网站:https://python123.io/ws/demo.html # -*- coding: utf-8 -*- """ Created on Tue J
阅读全文
摘要:1. 网络图片爬取 import os import requests root = ".//" url = "https://img2018.cnblogs.com/i-beta/817161/202001/817161-20200116224428592-123074215.png" path
阅读全文
摘要:1. cookie和session区别 2. 爬虫处理cookie和session 3. 处理cookies和session请求 4. 尝试使用session登录人人网(别试,了解一下) # -*- coding: utf-8 -*- import requests session = reques
阅读全文
摘要:1. requests模块发送post请求 # -*- coding: utf-8 -*- """ Created on Sun Jan 19 01:26:05 2020 @author: douzi """ # -*- coding: utf-8 -*- import requests impor
阅读全文
摘要:1. requests库安装 推荐使用anaconda,自带 2. requests使用 import requests r = requests.get("http://www.baidu.com") print(r.status_code) r.encoding = 'utf-8' print(
阅读全文
摘要:1. 字符串知识点 2. HTTP和HTTPS 3. url的形式 4. HTTP请求格式 5. GET和POST两种基本请求方法的区别 (1)GET把参数包含在URL中,POST通过request body传递参数。 (2)GET请求在URL中传送的参数是有长度限制的,而POST没有(大文本)。
阅读全文

浙公网安备 33010602011771号