Skip to main content
 首页 » 编程设计

python之用于在特定浏览器中打开 Google 搜索的脚本

2024年10月25日11xxx_UU

<分区>

我想在特定浏览器(如 Mozilla/google chrome)中使用 python 程序在谷歌上搜索特定短语。

import webbrowser 
 
url = "https://www.google.com.tr/search?q={}".format("Raspberry Pi")     
webbrowser.open(url) 

我在一些帖子中阅读了这个脚本,但它总是适用于系统中的默认浏览器,我不能选择或指定其他浏览器吗。