if sys.platform[:3] == "win":
class WindowsDefault(BaseBrowser):
def open(self, url, new=0, autoraise=True):
try:
os.startfile(url)
except WindowsError:
# [Error 22] No application is associated with the specified
# file for this operation: '<URL>'
return False
else:
return True
_tryorder = []
_browsers = {}
# First try to use the default Windows browser
register("windows-default", WindowsDefault)
# Detect some common Windows browsers, fallback to IE
iexplore = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"),
"Internet Explorer\\IEXPLORE.EXE")
for browser in ("firefox", "firebird", "seamonkey", "mozilla",
"netscape", "opera", iexplore):
if _iscommand(browser):
register(browser, None, BackgroundBrowser(browse()
好吧,找到问题了。我的浏览器被正确地默认为chrome,问题是网络浏览器.py文件。第539-563行内容如下:
我需要做的就是把“chrome”添加到for browser in(列表)的列表中。在
在documentation之后,您可以使用以下几种方法:
BROWSER
webbrowser.get('chrome')
获取Chrome的控制器实例,然后使用该实例进行浏览相关问题 更多 >
编程相关推荐