当前位置:网站首页>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 '
边栏推荐
- 计数排序和排序的稳定性
- [word Tutorial Series Part 1] how to remove arrows in word tables
- 自动化测试的生命周期是什么?
- 笔记
- 【Flutter 問題系列第 71 篇】Flutter 中 Uint8List 和 Image 之間的相互轉換
- Thinking about lever
- Tanghongbin, Yaya live CTO: to truly localize, the product should not have the attribute of "origin"
- 论文解读(DCN)《Towards K-means-friendly Spaces: Simultaneous Deep Learning and Clustering》
- 2022年PMP项目管理考试敏捷知识点(4)
- urllib.parse 解析url连接中的参数
猜你喜欢

CMake教程(一)

Machine learning 4-dimension reduction technology

融云通信解决方案 破解企业沟通痛点

【OpenCV】—线性滤波:方框滤波、均值滤波、高斯滤波

【状态机设计】Moore、Mealy状态机、三段式、二段式、一段式状态机书写规范
![[matlab] function definition and use](/img/43/a7970ca8e075151277f7773434f7db.png)
[matlab] function definition and use
![LeetCode 324 擺動排序 II[排序 雙指針] HERODING的LeetCode之路](/img/41/b8ba8d771b7224eac1cc8c54fe9d29.png)
LeetCode 324 擺動排序 II[排序 雙指針] HERODING的LeetCode之路

Finally, someone explained the cloud native architecture
![[stm32 HAL库] RTC和BKP驱动](/img/72/c2c46377d0a2a5a032802640ca0201.png)
[stm32 HAL库] RTC和BKP驱动

10. Standard i/o redirection and pipeline
随机推荐
Design e-commerce seckill system
自媒体行业内卷严重:企业自媒体应该何去何从
没找到实习,他总结了这些
Use conditional breakpoints in vscode (based on GDB)
Oil monkey script learning
VSCode里使用条件断点(基于GDB)
Master the usage of const
【状态机设计】Moore、Mealy状态机、三段式、二段式、一段式状态机书写规范
Understand shell script in one article
2022-06-28:以下golang代码输出什么?A:true;B:false;C:panic;D:编译失败。 package main import “fm
Prometeus 2.36.0 new features
Add the premise of ganggan
Online sql to htmltable tool
IDC: Alibaba cloud ranks first in the market share of China's data governance platform in 2021
网上注册股票开户很困难么?在线开户是安全么?
是使用local_setup.bash 还是 setup.bash
Insomnia last night
frameworks/base/core/res/res/values/symbols. Xml:3915: error: no definition for declared symbol solution
keil工程,程序写多后,RTT不能打印
Junior, it's not easy!