Created
December 27, 2014 03:26
-
-
Save legnaleurc/56b9cb14e0201bd6adc8 to your computer and use it in GitHub Desktop.
webview example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
import sys | |
from PySide import QtGui, QtWebKit | |
app = QtGui.QApplication(sys.argv) | |
wv = QtWebKit.QWebView() | |
wv.load('https://www.google.com/') | |
def on_load_finished(ok): | |
if not ok: | |
return | |
a = wv.page().mainFrame().findAllElements('a') | |
for e in a: | |
print(e.attribute('href')) | |
wv.page().loadFinished.connect(on_load_finished) | |
wv.show() | |
app.exec_() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment