我使用chrome Momentum扩展来定制我的浏览器新选项卡,并想编写一个python脚本来获得它的每日仪表板墙纸
现在我知道我可以通过url访问所需页面
chrome-extension://laookkfknpbbblfpciffpaejjkokdgca/dashboard.html
但是,当我尝试使用此url调用urllib.request.urlopen
时,出现以下错误:
urllib.error.URLError: <urlopen error unknown url type: chrome-extension>
是否可以包含由urllib
打开的自定义协议
或者是否有其他方法获得页面html结果
如果该文件存在于本地而不在web上,那么使用urllib不会对您有多大好处,因为它不是URL
改用webbrowser库并提供文件的路径:
相关问题 更多 >
编程相关推荐