@kstruct: My preferred way, instead of writing a full browser with QtWebKit and PyQt4, is to use one already written. There's the PhantomJS (C++) project, or PyPhantomJS (Python). Basically the Python one is QtWebKit and Python.
They're both headless browsers which you can control directly from JavaScript. The Python version has a plug-in system which allows you to extend the core too, to allow additional functionalities should you need.
Here's an example script for PyPhantomJS (with the saveToFile plugin)
// create new webpage
var page = new WebPage();
// open page, set callback
page.open('url', function(status) {
// exit if page couldn't load
if (status !== 'success') {
console.log('FAIL to load!');
phantom.exit(1);
}
// save page content to file
phantom.saveToFile(page.content, 'myfile.txt');
phantom.exit();
});
Useful links:
API reference | How to write plugins