qtwebkit

QtWebkit: console application

前提是你 提交于 2019-11-30 14:13:56
问题 I am new to Qt. I am building a console application and I need to process lot of real world html pages. QtWebkit comes as an easy choice because of clearly cut APIs and easy availability. I checked out the docs and they say that I can load pages by using QWebView::load(). But I am building a console application and I cannot use a widget. I get the error as: ? QWidget: Cannot create a QWidget when no GUI is being used The program has unexpectedly finished. So how can I process the html pages

How to get detailed error message when QTWebKit fails to load a page?

↘锁芯ラ 提交于 2019-11-30 12:17:56
QtWebKit calls QWebPage::loadFinished ( false ) when a web page failed to load - but gives no clue as to why it failed. How do I get a detailed error message, like HTTP response code or other message? Blake Scholl It turns out there are a couple ways to get more detail about failures: Implement the onResourceRequested and onResourceReceived callbacks on page: page.onResourceRequested = function (resource) { log('resource requested: ' + resource.url); } page.onResourceReceived = function (resource) { log('resource received: ' + resource.status + ' ' + resource.statusText + ' ' + resource

QtWebkit: console application

大憨熊 提交于 2019-11-30 10:08:40
I am new to Qt. I am building a console application and I need to process lot of real world html pages. QtWebkit comes as an easy choice because of clearly cut APIs and easy availability. I checked out the docs and they say that I can load pages by using QWebView::load(). But I am building a console application and I cannot use a widget. I get the error as: ? QWidget: Cannot create a QWidget when no GUI is being used The program has unexpectedly finished. So how can I process the html pages using QtWebkit in console application. Marçal Juan QtWebkit can be used in a widget-less environment,

Filling out a form using PyQt and QWebview

删除回忆录丶 提交于 2019-11-30 07:23:19
I would like to use PyQt/QWebview to 1) load a specific url, 2) enter information into a form, 3) click buttons/links. Mechanize does not work because I need an actual browser. Here's my code: import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import * from PyQt4 import QtCore app = QApplication(sys.argv) web = QWebView() web.load(QUrl("https://www.lendingclub.com/account/gotoLogin.action")) def fillForm(): doc = web.page().mainFrame().documentElement() user = doc.findFirst("input[id=master_username]") passwd = doc.findFirst("input[id=master_password]") user

ImportError: No module named QtWebKit

╄→гoц情女王★ 提交于 2019-11-29 19:29:33
问题 I am on centos5. I installed python26 source with a make altinstall. Then I did a: yum install qt4 yum install qt4-devel yum install qt4-doc From riverbankcomputing.co.uk I downloaded the source for sip 4.10.2, compiled and installed fine. Then from the same site I downloaded and compiled from source PyQt-x11-4.7.3 Both installs were using the python26 version (/usr/local/bin/python2.6). So configure.py, make, and make install worked with no errors. Finally, I tried to run this script, but

Is that possible to build static Qt library with webkit enabled? And how?

℡╲_俬逩灬. 提交于 2019-11-29 18:52:46
问题 I tried to build static Qt library with the following command: ./configure --prefix=/usr/local/qt --static --accessibility --multimedia --audio-backend --svg --webkit --javascript-jit --script --scripttools --declarative --dbus --debug But I got a message said: WARNING: Using static linking will disable the WebKit module. Is that possible to build static Qt library with all modules enabled? and how? Thanks 回答1: For Qt 4.8.3 I had to patch the .pro files to make a single QtWebKit instead of

Qt WebKit On Mobile

 ̄綄美尐妖づ 提交于 2019-11-29 15:36:49
I am trying to render a web page. Qt says their QtWebKit is available for mobile since 4.8 here If you want to target mobile devices you should consider using QGraphicsWebView instead of QWebView. Both of them is under QtWebKit. So what am I missing? If you are talking about Android and iOS, it's just a no-no. Citing Digia from the release page of Qt 5.2: Qt Webkit is not supported on Android and we are working on providing a cross-platform API to integrate web content into mobile apps. If you you would like to incorporate web content into your Qt application, you need to use a native web

webkit_server hangs periodically when run from Capybara in Ruby

假如想象 提交于 2019-11-29 12:44:59
问题 I am having a problem where an instance of webkit_server with Capybara and capybara-webkit running headless connected to a local Xvfb screen hangs when visiting a URL. It seems to happen after several minutes of repeatedly visiting different URLs and executing finders. (I'm using capybara for a screen scraping application in vanilla Ruby, not for testing.) I've confirmed that when it hangs the site is still accessible (for example, through curl or wget on the command line). I've also tried

Filling out a form using PyQt and QWebview

蓝咒 提交于 2019-11-29 09:20:49
问题 I would like to use PyQt/QWebview to 1) load a specific url, 2) enter information into a form, 3) click buttons/links. Mechanize does not work because I need an actual browser. Here's my code: import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import * from PyQt4 import QtCore app = QApplication(sys.argv) web = QWebView() web.load(QUrl("https://www.lendingclub.com/account/gotoLogin.action")) def fillForm(): doc = web.page().mainFrame().documentElement() user =

Capture server response with QWebEngineView

北城余情 提交于 2019-11-29 08:43:58
I'm trying to create a Dialog in Qt which loads a URL (which I do not want to expose to the end-user, hence a Dialog). Once the user has entered their credentials on the page, the server returns a redirect URL which I want to capture. How can I do this? QtWebkit made this easy to do as QWebView had a QNetworkAccessManager object. But with QtWebEngine, the QWebEngineView class does not have this capability. The former also allowed HTTP headers to be set for any requests by using the QNetworkRequest class and then load requests with these specific requests in QWebView. How do I do this with