我正在尝试让 python 打开一个网站 URL。此代码有效。
import webbrowser
url = 'http://www.example.com/'
webbrowser.open(url)
我注意到 python 只会打开https://
开头的 URL。
如果 URL 采用以下示例中的任何格式,是否可以让 python 打开 URL?
url = 'http://www.example.com/'
url = 'https://example.com/'
url = 'www.example.com/'
url = 'example.com/'
URL 将从外部来源中提取,因此我无法更改收到的数据。
我查看了 python 文档,但在 stackoverflow 上找不到答案。