当前位置:网站首页>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 '
边栏推荐
- C語言-單詞分析解析
- 华为22级专家十年心血终成云原生服务网格进阶实战文档,是真的6
- Complex nested object pool (4) -- manage the object pool of multi class instances and multi-stage instances
- Online sql to htmltable tool
- [stm32 HAL库] 串口通信
- 第三章 处理机调度练习
- One card can sell tens of millions, and the business expansion is faster than that of players: you don't understand the Jianghu of star cards
- Yes, use local_ setup. Bash or setup bash
- Is it safe to open a stock account on the Internet?
- 计数排序和排序的稳定性
猜你喜欢

计数排序和排序的稳定性

10. Standard i/o redirection and pipeline

At the end of June, how many people in Kangkang are ready to change jobs

Machine learning 4-dimension reduction technology

老家出资,俞敏洪设立两支基金
![[Chapter 2 of word tutorial series] how to set the table on each page to have a header in word](/img/1a/8416d2c48bf1ddcc45e0c5d9acf242.png)
[Chapter 2 of word tutorial series] how to set the table on each page to have a header in word

Go language - reflect
![[stm32 Hal library] RTC and BKP drives](/img/72/c2c46377d0a2a5a032802640ca0201.png)
[stm32 Hal library] RTC and BKP drives

Cs5463 code module analysis (including download link)

lock4j--分布式锁中间件--使用/实例
随机推荐
CIN at QT (the clearest tutorial in the whole network)
Tanghongbin, Yaya live CTO: to truly localize, the product should not have the attribute of "origin"
Langage C - analyse des mots
油猴脚本学习
Chapter II Classic synchronous exercises
2022-06-28:以下golang代码输出什么?A:true;B:false;C:panic;D:编译失败。 package main import “fm
第五章 虚拟存储器 练习
表单校验问题——el-select(初始化页面自动触发校验解决办法)
LeetCode 324 摆动排序 II[排序 双指针] HERODING的LeetCode之路
【Word 教程系列第 2 篇】Word 中如何设置每页的表格都有表头
华为22级专家十年心血终成云原生服务网格进阶实战文档,是真的6
云计算的迷路者
ctfshow XSS
Mathematical knowledge: finding combinatorial number I - finding combinatorial number
C# 面试题目_20220627记录一下
移动端异构运算技术 - GPU OpenCL 编程(基础篇)
[matlab] function definition and use
Encounter with avita 11: long lost freshness under strong product power
O & M troubleshooting - use hcache plug-in to troubleshoot excessive buffer/cache occupancy
Serious internal entanglement in the we media industry: where should the enterprise we media go