Python-如何在gtk.Window之类的webkit.WebView()中加载Google Chrome或Chromium浏览器? [英] Python - how to load Google Chrome or Chromium browser in the gtk.Window like webkit.WebView()?

查看:65
本文介绍了Python-如何在gtk.Window之类的webkit.WebView()中加载Google Chrome或Chromium浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Python(Linux)中,如何在gtk.Window()中加载Google chrome或Chromium浏览器?

In Python (Linux), how can i load the Google chrome or Chromium browser inside a gtk.Window()?

由于Javscript引擎和其他更新问题,我现在要在其中用作Webkit,但我需要使用Google Chrome/Chromium代替Webkit.

Where i am using now as webkit but instead of the webkit i need to use Google Chrome/Chromium because of the Javscript engine and other update issues.

$ apt-get install python-webkit
$ cat >> /var/tmp/browser.py << \EOF
#!/usr/bin/env python
import gtk
import webkit
import gobject
gobject.threads_init()
win = gtk.Window()
win.set_title("Python Browser")
bro = webkit.WebView()
bro.open("http://www.google.com")
win.add(bro)
win.show_all()
gtk.main()

EOF
$ python /var/tmp/browser.py

推荐答案

我认为您不能嵌入Chrome……您不能在Qt中创建应用程序并嵌入QtWebkit……或者您可以在任何驱动程序中使用硒您希望包括Chrome,但我认为您不能将其嵌入.

I don't think you can embed Chrome ... you can create your application in Qt and embed QtWebkit ... or you can use selenium with whatever driver you wish including Chrome , but i don't think you can embed that .

Qtwebkit具有您所需的所有功能.

Qtwebkit has all the features that you need.

编辑

我收回了所有东西,因为我发现了可能有用的东西.:D

I take everything back because I just found something that might work. :D

https://bitbucket.org/chromiumembedded/在其他应用程序中嵌入铬浏览器窗口的简单框架."

https://bitbucket.org/chromiumembedded/ "A simple framework for embedding chromium browser windows in other applications."

,此框架还具有python绑定: http://code.google.com/p/cefpython/

and this framework also has python bindings: http://code.google.com/p/cefpython/

但是我不确定铬是否具有您需要的所有功能...

but i'm not sure if chromium has all the features that you need ...

这篇关于Python-如何在gtk.Window之类的webkit.WebView()中加载Google Chrome或Chromium浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆