如何解决如何在 Python 中编写用于打开网站的条件语句
如果页面不在默认浏览器上,我想获取打开网页的代码。如果页面在默认浏览器上打开,则不会打开 Chrome 页面。例如,如果我为 YouTube 打开了一个标签,则代码不会为 YouTube 打开一个新标签。如果浏览器没有 YouTube 标签,则代码会为 YouTube 创建一个新标签。
import time
import hashlib
import webbrowser
#product = input("Enter the name of the product you want to buy: ")
webpage = input("Enter the link to the webpage: ")
#get the webpage of the link
webbrowser.get('windows-default').open(webpage)
print("web page opened")
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。