4.Python4:requests

目录

1.requests爬虫原理

(1)requests是一个python的第三方库,主要用于发送http请求

2.正则表达式


python 复制代码
#正则表达式
import re,requests
str1='aceace'
#A(.*?)B,匹配A和B之间的值
print(re.findall('a(.*?)e',str1))


python 复制代码
import re,requests
str2='''hello computer
world
'''
print(re.findall('hello(.*?)world',str2))
print(re.findall('hello(.*?)world',str2,re.S))


相关推荐
Zzzz_my2 分钟前
正则表达式(RE)
pytorch·python·正则表达式
天天鸭30 分钟前
前端仔写了个 AI Agent,才发现大模型只干了 10% 的活
前端·python·ai编程
setmoon2141 小时前
使用Scikit-learn构建你的第一个机器学习模型
jvm·数据库·python
2401_833197731 小时前
为你的Python脚本添加图形界面(GUI)
jvm·数据库·python
敏编程2 小时前
一天一个Python库:tomlkit - 轻松解析和操作TOML配置
python
2401_879693872 小时前
使用Python进行图像识别:CNN卷积神经网络实战
jvm·数据库·python
yunyun321232 小时前
机器学习模型部署:将模型转化为Web API
jvm·数据库·python
团子和二花3 小时前
openclaw平替之nanobot源码解析(七):Gateway与多渠道集成
python·gateway·agent·智能体·openclaw·nanobot
未知鱼3 小时前
Python安全开发之简易目录扫描器(含详细注释)
开发语言·python·安全
Be1k03 小时前
推荐一款语雀知识库批量导出工具
python·gui·工具·语雀·批量导出·原创