C++ (Qt)#include <QApplication>#include <QtWebKit/QWebView> int main(int argc, char *argv[]){ QApplication a(argc, argv); QWebView *view = new QWebView(); view->load(QUrl("http://gama-gama.ru/")); view->show(); return a.exec();}
Pythonclass UserAgentWebPage(QWebPage): def userAgentForUrl(self, url): return "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0" def javaScriptConsoleMessage(self, msg, line, source): print('%s line %d: %s' % (source, line, msg))
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="refresh" content="10;URL=/ciez2a"><script src="https://tars2.variti.net/share/aYfXXK0DJ4Y1?sid=108&scheme=http&host=gama-gama.ru&uri=%2f&t=1481888076642&sad=v%2fsDgAmg%3d%3d&uid=iUHgqjLXqoGlw0TH&uct=1481888076641&kct=0&m=4&ver=3&v=T7XgbckrrOYo_1d7_7tM3g&test=0DJ4Y1"></script></head><body> <script type="text/javascript"> var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); var done = false; // Handle Script loading var url = "https://tars2.variti.net/share/aYfXXK0DJ4Y1?sid=108&scheme=http&host=gama-gama.ru&uri=%2f&t=1481888076642&sad=v%2fsDgAmg%3d%3d&uid=iUHgqjLXqoGlw0TH&uct=1481888076641&kct=0&m=4&ver=3&v=T7XgbckrrOYo_1d7_7tM3g"; if (window.callPhantom || window._phantom || window.__phantomas) { url = url + "&test=aYfXXK"; } else { url = url + "&test=0DJ4Y1"; } script.src = url; script.onload = script.onreadystatechange = function() { // Attach handlers for all browsers if ( !done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") ) { done = true; ipp.setCookie(); location.href="http://gama-gama.ru/?utm_referrer="; script.onload = script.onreadystatechange = null; // Handle memory leak in IE } }; head.appendChild(script); </script></body></html>
C++ (Qt)#include <QApplication>#include <QWebEngineView> int main(int argc, char *argv[]){ QApplication app(argc, argv); QWebEngineView w; w.load(QUrl("http://gama-gama.ru/")); w.show(); return app.exec();}
Pythonurl = 'http://gama-gama.ru/' from PyQt5.QtCore import *from PyQt5.QtWidgets import *from PyQt5.QtWebEngineWidgets import * app = QApplication([]) view = QWebEngineView()view.setWindowTitle('Qt5 QWebEngineView')view.show() view.load(QUrl(url)) app.exec()
Pythonfrom PyQt4.QtCore import *from PyQt4.QtGui import *from PyQt4.QtWebKit import * app = QApplication([]) view = QWebView()view.setWindowTitle('Qt4 QWebView')view.show() view.load(QUrl(url)) app.exec()