Note that there are some explanatory texts on larger screens.

plurals
  1. POPySide. Extracting DOM HTML. AccessNetworkmanager
    text
    copied!<p>I need to extract all calendar data from page like "<a href="http://www.dukascopy.com/swiss/english/marketwatch/calendars/eccalendar/" rel="nofollow">http://www.dukascopy.com/swiss/english/marketwatch/calendars/eccalendar/</a>". Firstly - to extract all html with inner dom. Using eclipse and Python 3.3, win7. Searched here answers, and coded smth based on them. Looks like:</p> <pre><code>from PySide import QtGui, QtDeclarative from PySide.QtGui import QApplication, QDesktopServices, QImage, QPainter from PySide.QtCore import QByteArray, QUrl, QTimer, QEventLoop, QIODevice, QObject from PySide.QtWebKit import QWebFrame, QWebView, QWebPage, QWebSettings from PySide.QtNetwork import QNetworkAccessManager, QNetworkProxy, QNetworkRequest, QNetworkReply, QNetworkDiskCache #!/usr/bin/env python """ app = QApplication(sys.argv) web = QWebView() web.load(QUrl("http://www.dukascopy.com/swiss/english/marketwatch/calendars/eccalendar/")) web.show() sys.exit(app.exec_()) """ app = QApplication(sys.argv) w = QWebView() request = QNetworkRequest(QUrl("http://www.dukascopy.com/swiss/english/marketwatch/calendars/eccalendar/")) reply = w.page().networkAccessManager().get(request) print(reply) byte_array = reply.readAll() plist = reply.rawHeaderList() print(plist) print(byte_array) </code></pre> <p>When loading page to QWebView() it works fine (commented code), but I couldn't find how to extract all html from QWebView(). So i tried via "request" - decommented code. And nothing prints.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload