简体   繁体   中英

Need help understanding WebKit for python

today I came across WebKit. And I'm trying to understand what is it? and is it possible to use webkit without gtk? I can't find any information about how to use 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? Also would like to know is it possible to open the page and than display html code in console? Like I would normally do with urllib2 or mechanize and BeautifulSoup.

This is the complete api documentation of PySide:

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

with a subsection dedicated to webkit only:

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

And there's PyQt's documentation too, but that's not that much pythonic:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM