随笔分类 -  python

摘要:Mongodb基本使用python 引入依赖 pip3 install pymongo 连接Mongodb import pymongo client = pymongo.MongoClient(host='127.0.0.1', port=27017) col = client['go'] spring 导入依赖 <d 阅读全文
posted @ 2023-05-18 14:00 Kang_kin 阅读(56) 评论(0) 推荐(0)
摘要:Redis-py和Redistemplate常用命令python相关配置 安装包 pip3 install redis 导入 import redis 连接 redis.StrictRedis('127.0.0.1', 6379, 0, password=123456) spring相关配置 引入maven <dependency> <groupId 阅读全文
posted @ 2023-05-15 23:39 Kang_kin 阅读(221) 评论(0) 推荐(0)
摘要:Selenium 案例 import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys fro 阅读全文
posted @ 2023-05-07 16:30 Kang_kin 阅读(200) 评论(0) 推荐(0)
摘要:异步爬虫 基础知识 阻塞 ​ 阻塞状态指程序未得到所需计算资源时被挂起的状态。程序在等待某个操作完成期间,自身无法继续干别的事情,则该程序在操作上是阻塞的。 ​ 常见的阻塞形式有:网络I/O阻塞、磁盘I/O阻塞、用户输入阻塞等。阻塞是无处不在的,包括在CPU切换上下文时,所有进程都无法真正干事情,它 阅读全文
posted @ 2023-05-05 19:59 Kang_kin 阅读(112) 评论(0) 推荐(0)
摘要:python3解析库(Beautiful Soup、pyquery、parsel)Beautiful Soup 基本使用 <html> <head> <title> The Document's story </title> </head> <body> <p class="title" name="dromouse"><b>The Dormouse's story</b></p 阅读全文
posted @ 2023-04-27 21:54 Kang_kin 阅读(470) 评论(0) 推荐(0)
摘要:正则表达式 常用匹配规则 模式 描述 \w 匹配字母、数字以及下划线 \W 匹配不是字母、数字及下划线的字符 \s 匹配任意空白字符串,等价于[\t\n\r\f] \S 匹配任意非空字符串 \d 匹配任意数字,等价与[0-9] \D 匹配任意非数字的字符 \A 匹配字符串的开头 \Z 匹配字符串结尾 阅读全文
posted @ 2023-04-22 15:07 Kang_kin 阅读(696) 评论(0) 推荐(0)
摘要:Python3基本请求库-requests#requests 基本请求 import requests r=request.get('https://www.baidu.com/') print(type(r)) print(r.status_code) print(r.cookies) #get post put delete patch 阅读全文
posted @ 2023-04-17 17:01 Kang_kin 阅读(87) 评论(0) 推荐(0)
摘要:Python3基本请求库-urlliburllib urlopen 一个基本请求 from urllib import request, parse def Api(): # 禁用证书验证 ssl._create_default_https_context = ssl._create_unverified_context respons 阅读全文
posted @ 2023-04-15 17:56 Kang_kin 阅读(76) 评论(0) 推荐(0)