[英]Need help understanding WebKit for python
today I came across WebKit. 今天我遇到了WebKit。 And I'm trying to understand what is it? 而我试图了解它是什么? and is it possible to use webkit without gtk? 可以不使用gtk使用webkit吗? I can't find any information about how to use WebKit. 我找不到有关如何使用WebKit的任何信息。 So I found this example: 所以我找到了这个例子:
#! /usr/bin/python
import gtk, webkit
def update(view, frame, resource, request, response):
url=request.get_uri()
print url
win=gtk.Window()
win.connect('destroy', lambda w: gtk.main_quit())
win.show()
box1=gtk.HBox()
win.add(box1)
web=webkit.WebView()
web.connect('resource-request-starting', update)
box1.pack_start(web)
web.open('http://python.org')
box1.show_all()
gtk.main()
Where can I find documentation for webkit.WebView
or .open()
method? 在哪里可以找到webkit.WebView
或.open()
方法的文档? Also would like to know is it possible to open the page and than display html code in console? 还想知道是否可以打开页面并在控制台中显示html代码? Like I would normally do with urllib2 or mechanize and BeautifulSoup. 就像我通常使用urllib2或机械化和BeautifulSoup一样。
This is the complete api documentation of PySide: 这是PySide的完整api文档:
http://srinikom.github.com/pyside-docs/ http://srinikom.github.com/pyside-docs/
with a subsection dedicated to webkit only: 专门针对webkit的小节:
http://srinikom.github.com/pyside-docs/PySide/QtWebKit/index.html http://srinikom.github.com/pyside-docs/PySide/QtWebKit/index.html
That's a temporary mirror, the original was and will be located probably here: 那是一个临时的镜子,原来是并且可能位于这里:
http://pyside.org/docs/pyside/PySide/QtWebKit/index.html http://pyside.org/docs/pyside/PySide/QtWebKit/index.html
And there's PyQt's documentation too, but that's not that much pythonic: 并且也有PyQt的文档,但这不是很多pythonic:
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/index.html http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/index.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.