Home
Sign Up
Sign In
推荐学习书目
›
Learn Python the Hard Way
Python Sites
›
PyPI
- Python Package Index
›
http://diveintopython.org/toc/index.html
›
Pocoo
值得关注的项目
›
PyPy
›
Celery
›
Jinja2
›
Read the Docs
›
gevent
›
pyenv
›
virtualenv
›
Stackless Python
›
Beautiful Soup
›
结巴中文分词
›
Green Unicorn
›
Sentry
›
Shovel
›
Pyflakes
›
pytest
Python 编程
›
pep8 Checker
Styles
›
PEP 8
›
Google Python Style Guide
›
Code Style from The Hitchhiker's Guide
V2EX
›
Python
Python 爬虫中怎么讲 url 地址转义为文件名?
wyy
·
Mar 15, 2018
· 4866 views
This topic created in 3170 days ago, the information mentioned may be changed or developed.
Python
URL
地址
文件
7 replies
•
2018-03-15 17:34:31 +08:00
julyclyde
Mar 15, 2018
1
什么文件的名?
wyy
OP
Mar 15, 2018
1
2
urllib 中的 urlencode 就可以了,注意要用字典的形式作为输入 value
wyy
OP
Mar 15, 2018
3
@
julyclyde
windows 系统中合法的文件名
tarekyoog
Mar 15, 2018 via Android
4
url.split('/')[-1]
netChen
Mar 15, 2018
5
网址中的‘.’在 Windows 系统中应该不能做文件名
binux
Mar 15, 2018
6
你要自己定一个转义规则
Arthur2e5
Mar 15, 2018 via Android
7
@
netChen
当然可以。你下载个 bash-4.4.tar.gz 试试?
@
wyy
urlencode 按 URL 合法性的会错过冒号之类一堆东西,闭着眼睛直接搞的又嫌浪费路径长度…还是需要自己列字符就是
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
4051 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 37ms ·
UTC 03:54
·
PVG 11:54
·
LAX 19:54
·
JFK 22:54
♥ Do have faith in what you're doing.
❯