私信  •  关注

malberts

malberts 最近创建的主题
malberts 最近回复了
5 年前
回复了 malberts 创建的主题 » 操作列表(URL)中的值-Python

以下是创建URL的更可靠的方法:

from urllib.parse import unquote

region_urls = [response.urljoin(unquote(x)) for x in regions]

urljoin 根据当前响应的基URL和相对URL创建正确的绝对URL。

unquote %.. 符号,以防你也得到别人。