主页
Python
Python urllib 模块
demo_ref_module_urllib_basic
运行 ❯
×
更改方向
保存代码
更改主题
from urllib.parse import urlparse url = 'https://www.example.com/path?query=value' parsed = urlparse(url) print(f'Scheme: {parsed.scheme}') print(f'Netloc: {parsed.netloc}') print(f'Path: {parsed.path}')
Scheme: https
Netloc: www.example.com
Path: /path