当前位置:主页 > 软件编程 > Python代码 >

解决Python 爬虫URL中存在中文或特殊符号无法请求的问题

时间:2021-02-13 11:15:29 | 栏目:Python代码 | 点击:

这种问题,初学者应该都会遇到,分享给大家做个参考!

from urllib.parse import quote
import string

#解决请求路径中含义中文或特殊字符
url_ = quote(new_url, safe=string.printable);

您可能感兴趣的文章:

相关文章