0

今天我遇到了WebKit。我试图了解它是什么?是否可以在没有 gtk 的情况下使用 webkit?我找不到任何有关如何使用 WebKit 的信息。所以我找到了这个例子:

#! /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()

我在哪里可以找到文档webkit.WebView.open()方法?还想知道是否可以打开页面并在控制台中显示 html 代码?就像我通常使用 urllib2 或 mechanize 和 BeautifulSoup 一样。

4

1 回答 1

1

这是 PySide 的完整 api 文档:

http://srinikom.github.com/pyside-docs/

有一个专门用于 webkit 的小节:

http://srinikom.github.com/pyside-docs/PySide/QtWebKit/index.html

那是一个临时镜像,原来的镜像可能位于并将位于此处:

http://pyside.org/docs/pyside/PySide/QtWebKit/index.html

还有 PyQt 的文档,但这不是 Python 的:

http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/index.html

于 2012-10-20T05:50:23.620 回答