qwebview

PDF with QWebView: missing refresh/repaint after loading

妖精的绣舞 提交于 2019-12-01 12:57:28
I use the QWebView (python 3.3 + pyside 1.1.2 + Qt 4.8) as FileViewer. Picture, Text, HTML, ... all fine, but PDF has a display problem. I tested two possible ways. internal pdf viewer: after use webview.load(file) it loads, but the screen is blank, after loading another file, all works fine, it shows the file pdf.js: after use setContent() with filebase, it loads the webviewer.html/.js with a white page and the loading circle. The screen only refresh if I resize the form or use the scrollbars, but then all is fine I don't find an event for "plugin/javascript finished loading", so I could

QWebView not loading external javascript?

天涯浪子 提交于 2019-12-01 12:02:39
It is possible to load an external javascript file from the html using QWebView? In the following QtProject (all files in the same directory) there is javascript code directly inside the html and also in an external file. I'm missing the external behavior while loading it in QWebView (in the browser it works fine): MyApp.pro QT += core gui webkitwidgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = MyApp TEMPLATE = app DESTDIR = ./ SOURCES += main.cpp HEADERS += main.cpp #include <QApplication> #include <QtWebKitWidgets> #include <QFile> int main(int argc, char *argv[]) {

QWebView not loading external javascript?

馋奶兔 提交于 2019-12-01 09:52:09
问题 It is possible to load an external javascript file from the html using QWebView? In the following QtProject (all files in the same directory) there is javascript code directly inside the html and also in an external file. I'm missing the external behavior while loading it in QWebView (in the browser it works fine): MyApp.pro QT += core gui webkitwidgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = MyApp TEMPLATE = app DESTDIR = ./ SOURCES += main.cpp HEADERS += main.cpp #include

Bokeh tools not working in QWebView

一世执手 提交于 2019-12-01 05:58:15
Good afternoon [ First time to post on stackoverflow after years of reading. Exciting! ] I use bokeh to generate html code that I feed into a QWebView in a very simple PyQt4 GUI. The standard tools on top of the bokeh chart do not work in the QWebView, while they work properly if I open the same html code in any standard browser (in my case, Chrome). Detailed example: I am using the snippet below taken from an older Bokeh User Guide example to test the issue (the latest User Guide can be found here ): from bokeh.plotting import figure from bokeh.resources import CDN, INLINE from bokeh.embed

Bokeh tools not working in QWebView

不打扰是莪最后的温柔 提交于 2019-12-01 03:21:49
问题 Good afternoon [ First time to post on stackoverflow after years of reading. Exciting! ] I use bokeh to generate html code that I feed into a QWebView in a very simple PyQt4 GUI. The standard tools on top of the bokeh chart do not work in the QWebView, while they work properly if I open the same html code in any standard browser (in my case, Chrome). Detailed example: I am using the snippet below taken from an older Bokeh User Guide example to test the issue (the latest User Guide can be

How to list loaded resources with Selenium/PhantomJS?

微笑、不失礼 提交于 2019-11-30 09:16:44
I want to load a webpage and list all loaded resources (javascript/images/css) for that page. I use this code to load the page: from selenium import webdriver driver = webdriver.PhantomJS() driver.get('http://example.com') The code above works perfectly and I can do some processing to the HTML page. The question is, how do I list all of the resources loaded by that page? I want something like this: ['http://example.com/img/logo.png', 'http://example.com/css/style.css', 'http://example.com/js/jquery.js', 'http://www.google-analytics.com/ga.js'] I also open to other solution, like using PySide

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

How to list loaded resources with Selenium/PhantomJS?

烂漫一生 提交于 2019-11-29 12:59:19
问题 I want to load a webpage and list all loaded resources (javascript/images/css) for that page. I use this code to load the page: from selenium import webdriver driver = webdriver.PhantomJS() driver.get('http://example.com') The code above works perfectly and I can do some processing to the HTML page. The question is, how do I list all of the resources loaded by that page? I want something like this: ['http://example.com/img/logo.png', 'http://example.com/css/style.css', 'http://example.com/js

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