Python 降低() return "\u200b"
Python lower() return "\u200b"
我想使用 Requests 库请求 POST。
但问题出在 get_adapter.
我的 url 是“http://sample_domain.com/sample_endpoint”。
但是 if url.lower().startswith(prefix.lower())
去世了 我的 url 是 "\u200bhttp://sample_domain.com/sample_endpoint".
为什么 \u200b
?我无法通过这个循环。
只是 return InvalidSchema
.
您可能从网站复制了 URL。 \u200b
就是 zero-width space character。您看不到它(因为它是零宽度),但它可能是网站的一部分。有时它用于格式化原因。
在Python中的字符串表示中是这样表示的
解决方案: 只需确保只 select 文本,或者确保您的代码删除该字符,因为它不是 URL 的一部分, 因此如果将其保留在字符串中将不起作用。
我想使用 Requests 库请求 POST。 但问题出在 get_adapter.
我的 url 是“http://sample_domain.com/sample_endpoint”。
但是 if url.lower().startswith(prefix.lower())
去世了 我的 url 是 "\u200bhttp://sample_domain.com/sample_endpoint".
为什么 \u200b
?我无法通过这个循环。
只是 return InvalidSchema
.
您可能从网站复制了 URL。 \u200b
就是 zero-width space character。您看不到它(因为它是零宽度),但它可能是网站的一部分。有时它用于格式化原因。
在Python中的字符串表示中是这样表示的
解决方案: 只需确保只 select 文本,或者确保您的代码删除该字符,因为它不是 URL 的一部分, 因此如果将其保留在字符串中将不起作用。