当前位置:网站首页>urllib. Parse parses the parameters in the URL connection
urllib. Parse parses the parameters in the URL connection
2022-06-28 23:25:00 【supramolecular】
from urllib.parse import urlparse, parse_qs,unquote
urldata = "'https://zhidao.baidu.com/search?lm=0&rn=10&pn=0&fr=search&ie=gbk&word=%C8%AB%CD%F8%D3%AA%CF%FA'"
urldata = unquote(urldata, encoding='gbk', errors='replace')
result = urlparse(urldata)
print(result)
print(parse_qs(result.query))
keyword = parse_qs(result.query)['word'][0]
print(keyword)result
ParseResult(scheme='', netloc='', path="'https://zhidao.baidu.com/search", params='', query="lm=0&rn=10&pn=0&fr=search&ie=gbk&word= Whole network marketing '", fragment='')
{'lm': ['0'], 'rn': ['10'], 'pn': ['0'], 'fr': ['search'], 'ie': ['gbk'], 'word': [" Whole network marketing '"]}
Whole network marketing '
边栏推荐
- 2022 PMP project management examination agile knowledge points (4)
- Complex nested object pool (4) -- manage the object pool of multi class instances and multi-stage instances
- 自媒体行业内卷严重:企业自媒体应该何去何从
- Interpretation of papers (DCN) towards k-means-friendly spaces: simultaneous deep learning and clustering
- [数学建模]Matlab非线性规划之fmincon()函数
- [conception de la machine d'état] Moore, Mealy State Machine, Three - stage, Two - stage, one - stage State Machine Writing Specification
- 【Flutter 问题系列第 71 篇】Flutter 中 Uint8List 和 Image 之间的相互转换
- Lock4j -- distributed locking Middleware -- use / instance
- urllib.parse 解析url连接中的参数
- lock4j--分布式锁中间件--使用/实例
猜你喜欢

华为22级专家十年心血终成云原生服务网格进阶实战文档,是真的6

C# 面试题目_20220627记录一下

Tanghongbin, Yaya live CTO: to truly localize, the product should not have the attribute of "origin"

IDC: Alibaba cloud ranks first in the market share of China's data governance platform in 2021

window10 phpstudy 安装redis扩展

Chapter V virtual memory exercise
![Leetcode 324 Swing sort II [tri double pointeur] le chemin du leetcode pour l'héroding](/img/41/b8ba8d771b7224eac1cc8c54fe9d29.png)
Leetcode 324 Swing sort II [tri double pointeur] le chemin du leetcode pour l'héroding
![[matlab] function definition and use](/img/43/a7970ca8e075151277f7773434f7db.png)
[matlab] function definition and use

2022年PMP项目管理考试敏捷知识点(4)

见丰知夏|国漫鼻祖丰子恺,数字藏品独家发售
随机推荐
Non scientific class! The road of self-study!
CS5463代码模块解析(包含下载链接)
Lost in cloud computing
YuMinHong set up two funds funded by his hometown
[sword finger offer] 50 First character that appears only once
笔记
在QT进行cin(全网最清晰教程)
大三,不简单啊!
PHP利用CURL实现登录网站后下载Excel文件
[stm32 Hal library] serial port communication
没找到实习,他总结了这些
[API packet capturing in selenium automation] installation and configuration of browsermobproxy
第二章 经典同步练习作业
复杂嵌套的对象池(4)——管理多类实例和多阶段实例的对象池
lock4j--分布式锁中间件--使用/实例
Yyds dry inventory solution sword finger offer: maximum sum of continuous subarrays (II)
移动端异构运算技术 - GPU OpenCL 编程(基础篇)
With a monthly salary of 60000 yuan, such people began to be robbed after the Internet "reduced costs and increased efficiency"
2022 PMP project management examination agile knowledge points (4)
Interviewer: what is the internal implementation of strings in redis?