class FormWidget(QWidget): def __init__(self, parent): super(FormWidget, self).__init__(parent) self.__controls() self.__layout() def __controls(self): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "test2.html") print(path) #html = open('test2.html', 'r').read() self.browser = QWebEngineView() self.browser.setPage(WebPage(self.browser)) #self.browser.load(QUrl.fromLocalFile(path)) self.browser.load(QUrl("http://localhost:5000")) #//self.browser.setHtml(") #self.browser.loadFinished.connect(self.onLoadFinished) """ def onLoadFinished(self, ok): pass #if ok: # #self.browser.page().runJavaScript("helloWorld(1, \"2\")", self.ready) """ def __layout(self): self.vbox = QVBoxLayout() self.hBox = QVBoxLayout() self.hBox.addWidget(self.browser) self.vbox.addLayout(self.hBox) self.setLayout(self.vbox) def ready(self, returnValue): print(returnValue)
class Form(QObject): def __init__(self, ui_file, parent=None): super(Form, self).__init__(parent) ui_file = QFile(ui_file) ui_file.open(QFile.ReadOnly) loader = QUiLoader() self.window = loader.load(ui_file) ui_file.close() self.host = self.window.findChild(QLineEdit, 'userText') self.pw = self.window.findChild(QLineEdit, 'passwordText') btn = self.window.findChild(QPushButton, 'submitButton') btn.clicked.connect(self.button_handler) self.window.show() def loadMap(self): print("load map here!") self.browser = QWebEngineView() self.browser.load(QUrl('https://www.google.com/maps')) self.browser.show() def button_handler(self): if self.host.text() == "host" and self.pw.text() == "pass": print('Success!') self.loadMap() else: print('Invalid login!')
def __init__(self, parent): """Description of this module.""" super().__init__() self.parent = parent self.name = "Profile" self.html = QWebEngineView() self.bt_close = QPushButton('Close') self.bt_close.setIcon(self.style().standardIcon( QStyle.SP_DialogCloseButton)) self.bt_close.clicked.connect(lambda: self.parent.close_tab_top(self)) self.bt_maxfig = QPushButton('Expand / Retract') self.bt_maxfig.setIcon(self.style().standardIcon( QStyle.SP_TitleBarMaxButton)) self.bt_maxfig.clicked.connect(self.parent.toggle_max_figure) self.grid1 = QGridLayout() self.grid1.setColumnStretch(0, 1) self.grid1.addWidget(QWidget(), 0, 0, 1, 3) self.grid1.addWidget(self.bt_maxfig, 0, 4, 1, 1) self.grid1.addWidget(self.bt_close, 0, 5, 1, 1) self.vbox = QVBoxLayout() self.vbox.addLayout(self.grid1) self.vbox.addWidget(self.html) self.setLayout(self.vbox)
def stack_details(self): page_css = '''background-color: #2D2D2D; color: #ffffff;''' ################################################################################################################ # page1 ################################################################################################################ self.page_1.setStyleSheet(page_css) self.page_1_layout = QVBoxLayout(self) self.anime = QWebEngineView() self.anime.setUrl(QUrl("https://animixplay.to")) self.page_1_layout.addWidget(self.anime) self.page_1.setLayout(self.page_1_layout) ################################################################################################################ # page 2 ################################################################################################################ self.page_2.setStyleSheet(page_css) self.page_2_layout = QVBoxLayout(self) self.manga_read = QWebEngineView() self.manga_read.setUrl(QUrl("https://manganelo.com")) self.page_2_layout.addWidget(self.manga_read) self.page_2.setLayout(self.page_2_layout)
def __init__(self): super(MainWindow, self).__init__() self.setWindowTitle('PySide2 WebEngineWidgets Example') self.toolBar = QToolBar() self.addToolBar(self.toolBar) self.backButton = QPushButton() self.backButton.setIcon( QIcon(':/qt-project.org/styles/commonstyle/images/left-32.png')) self.backButton.clicked.connect(self.back) self.toolBar.addWidget(self.backButton) self.forwardButton = QPushButton() self.forwardButton.setIcon( QIcon(':/qt-project.org/styles/commonstyle/images/right-32.png')) self.forwardButton.clicked.connect(self.forward) self.toolBar.addWidget(self.forwardButton) self.addressLineEdit = QLineEdit() self.addressLineEdit.returnPressed.connect(self.load) self.toolBar.addWidget(self.addressLineEdit) self.webEngineView = QWebEngineView() self.setCentralWidget(self.webEngineView) initialUrl = 'http://qt.io' self.addressLineEdit.setText(initialUrl) self.webEngineView.load(QUrl(initialUrl)) self.webEngineView.page().titleChanged.connect(self.setWindowTitle) self.webEngineView.page().urlChanged.connect(self.urlChanged)
def __init__(self, filename, parent=None): super(LocationWidget, self).__init__(parent) self.temp_dir = QTemporaryDir() if self.temp_dir.isValid(): with exiftool.ExifTool(exiftool_exe()) as et: temp_file = os.path.join(self.temp_dir.path(), "geo.html") metadata = et.get_metadata(filename) try: lat = metadata["Composite:GPSLatitude"] long = metadata["Composite:GPSLongitude"] except KeyError: label = QLabel(self.tr("Geolocation data not found!")) modify_font(label, bold=True) label.setStyleSheet("color: #FF0000") label.setAlignment(Qt.AlignCenter) layout = QVBoxLayout() layout.addWidget(label) self.setLayout(layout) return html = '<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2948.532014673314!2d{}!3d{}!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x0!2zNDLCsDIxJzA5LjAiTiA3McKwMDUnMjguMiJX!5e0!3m2!1sit!2sit!4v1590074026898!5m2!1sit!2sit" width="600" height="450" frameborder="0" style="border:0;" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>'.format( long, lat) with open(temp_file, "w") as file: file.write(html) web_view = QWebEngineView() web_view.load(QUrl("file://" + temp_file)) layout = QVBoxLayout() layout.addWidget(web_view) self.setLayout(layout)
def __init__(self, display=True): self.app = QApplication([]) QWebEngineView.__init__(self) print('SHow') if display: self.show() # show the browser print('SHow')
def __init__(self): super(ManualWindow, self).__init__() self.setWindowTitle('QAX Manual') icon_info = QFileInfo(app_info.app_icon_path) self.setWindowIcon(QIcon(icon_info.absoluteFilePath())) self.toolbar = QToolBar() self.addToolBar(self.toolbar) self.back_button = QPushButton() self.back_button.setIcon(qta.icon('fa.arrow-left')) self.back_button.clicked.connect(self.back) self.toolbar.addWidget(self.back_button) self.forward_button = QPushButton() self.forward_button.setIcon(qta.icon('fa.arrow-right')) self.forward_button.clicked.connect(self.forward) self.toolbar.addWidget(self.forward_button) self.address_line_edit = QLineEdit() self.address_line_edit.returnPressed.connect(self.load) self.address_line_edit.setVisible(False) self.toolbar.addWidget(self.address_line_edit) self.web_engine_view = QWebEngineView() self.web_engine_view.setZoomFactor(2.0) self.setCentralWidget(self.web_engine_view) initialUrl = self.docs_url() self.address_line_edit.setText(str(initialUrl)) self.web_engine_view.load(QUrl(initialUrl)) self.web_engine_view.page().urlChanged.connect(self.urlChanged)
class HelpWindow(QMainWindow): def __init__(self, parent=None): super(HelpWindow,self).__init__(parent) self.setWindowTitle("Facepager 3.0 - Help") self.setMinimumWidth(600); self.setMinimumHeight(600); central = QWidget() self.setCentralWidget(central) vLayout = QVBoxLayout(central) self.page = MyQWebEnginePage() self.browser = QWebEngineView(central) self.browser.setPage(self.page) vLayout.addWidget(self.browser) hLayout = QHBoxLayout() vLayout.addLayout(hLayout) hLayout.addStretch(5) dismiss = QPushButton(central) dismiss.setText("Close") dismiss.clicked.connect(self.hide) hLayout.addWidget(dismiss) #browser.setBackgroundRole(QPalette.Window) def show(self): super(HelpWindow,self).show() self.loadPage() def loadPage(self): self.browser.load(QUrl("http://strohne.github.io/Facepager/"))
def webkit_download(url): app = QApplication([]) webview = QWebEngineView() webview.loadFinished.connect(app.quit) webview.load(url) app.exec_() # delay here until download finished return webview.page().mainFrame().toHtml()
def main(): app = QApplication(sys.argv) #shared= QSharedMemory("wepush") #if shared.attach(): #return 0 #shared.create(1) #sys.stdout=common.Mystd() loop = QEventLoop(app) asyncio.set_event_loop(loop) win = QWebEngineView() # QWebEngineView() director['root_win'] = win #thread.start_new_thread (server.start_server,(28289,)) #win =QWebView() #win.setWindowIcon(QIcon( './html/wechat.ico')) win.setMinimumSize(1200, 900) win.setWindowTitle('微信群发工具V1.0') url = 'file:///%s/test.html' % base_dir.replace('\\', '/') win.load(QUrl(url)) win.show() with loop: from server import start_server #loop.set_debug(True) loop.run_until_complete(start_server) #loop.create_task(send()) #loop.create_task(start_server) loop.run_forever()
def __init__(self, parent=None, caption="", url=""): super(WebDialog, self).__init__(parent) self.url = url self.setWindowTitle(caption) self.setMinimumWidth(600) self.setMinimumHeight(500) vLayout = QVBoxLayout() self.setLayout(vLayout) self.page = MyQWebEnginePage() self.browser = QWebEngineView(self) self.browser.setPage(self.page) vLayout.addWidget(self.browser) # Buttons hLayout = QHBoxLayout() vLayout.addLayout(hLayout) hLayout.addStretch(5) buttonDismiss = QPushButton(self) buttonDismiss.setText("Cancel") buttonDismiss.clicked.connect(self.reject) hLayout.addWidget(buttonDismiss) buttonProceed = QPushButton(self) buttonProceed.setText("Proceed") buttonProceed.setDefault(True) buttonProceed.clicked.connect(self.accept) hLayout.addWidget(buttonProceed) self.loadPage()
def __init__(self, parent=None): super(EditorWidget, self).__init__(parent) web_view = QWebEngineView() web_view.load(QUrl('https://hexed.it/')) layout = QVBoxLayout() layout.addWidget(web_view) self.setLayout(layout)
class MaiteBody(QWidget): """Main display body""" def __init__(self): super().__init__(None) # main horizontal view hlay = QHBoxLayout() # left pane e1 = QLineEdit() hlay.addWidget(e1, 25) # right pane self.webEngineView = QWebEngineView() current_path = os.getcwd() fileLocation = current_path + "/reloj.html" print(fileLocation) url = QUrl.fromLocalFile(fileLocation) self.webPage = self.webEngineView.page() self.webEngineView.load(url) self.webEngineView.show() hlay.addWidget(self.webEngineView, 75) self.setLayout(hlay)
def __init__( self, notebook_generator: "NotebookProjectGenerator", project_manager: "ProjectManagerGUI", parent: "QWidget" = None, ): super().__init__(parent) # Components self._project_manager = project_manager self._notebook_generator = notebook_generator self._project_manager.active_project_changed.connect(self._set_active_project) # Widgets self._text_browser = QWebEngineView() self._text_browser.show() self._generate_notebook_button = QPushButton("Generate Notebook") self._generate_notebook_button.clicked.connect(self._generate_html) # Layout self._main_layout = QVBoxLayout() self._main_layout.setContentsMargins(0, 0, 0, 0) self._main_layout.addWidget(self._text_browser) self._main_layout.addWidget(self._generate_notebook_button) self.setLayout(self._main_layout) # Set active project and generate notebook self._set_active_project(self._project_manager.active)
def __init__(self, client_id='42e8e8e9d844e45c2d05', hint_username=None, parent=None): super(QGithubDeviceAuthDialog, self).__init__(parent=parent) self.setWindowTitle('Log into your GitHub account and enter this code') self.__webview = QWebEngineView(parent=self) self.__webview.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.__webview.urlChanged.connect(self.on_url_changed) self.__infolaabel = QLabel( '<p style="font-size:14px">' '<br>You need to allow hpaste to modify your gists on github. for that you need to log in to your account and authorize hpaste.\n' '<br>You can do it in <b>any</b> browser, not only in this window. Just go to <a href="https://github.com/login/device">https://github.com/login/device</a> and enter the code below.\n' '<br>close this window when you are done' '</p>', parent=self) self.__infolaabel.setTextFormat(Qt.RichText) self.__infolaabel.setTextInteractionFlags(Qt.TextBrowserInteraction) self.__infolaabel.setOpenExternalLinks(True) self.__devidlabel = QLabel(parent=self) self.__devidlabel.setTextInteractionFlags(Qt.TextBrowserInteraction) ff = self.__devidlabel.font() ff.setPointSize(64) self.__devidlabel.setFont(ff) self.__reload_button = QPushButton('log in to a different account', parent=self) self.__reload_button.clicked.connect(self.reload_button_clicked) self.__layout = QVBoxLayout() self.setLayout(self.__layout) self.__layout.addWidget(self.__infolaabel) self.__layout.addWidget(self.__devidlabel) self.__layout.addWidget(self.__reload_button) self.__layout.addWidget(self.__webview) self.__result = None # self.setGeometry(512, 256, 1024, 768) self.resize(1024, 860) # init auth process self.__client_id = client_id self.__headers = { 'User-Agent': 'HPaste', 'Accept': 'application/json', 'charset': 'utf-8', 'Content-Type': 'application/json' } self.__hint_username = hint_username self.__webprofile = None self.__webpage = None self.__device_code = None self.__interval = None self.__await_login_redirect = False self.reinit_code()
class TextMediaView(MediaView): def __init__(self, media, parent): super(TextMediaView, self).__init__(media, parent) self.widget = QWebEngineView(parent) self.widget.setGeometry(media['geometry']) self.set_default_widget_prop() self.widget.setDisabled(True) @Slot() def play(self): self.finished = 0 path = '%s/%s_%s_%s.html' % (self.save_dir, self.layout_id, self.region_id, self.id) self.widget.load('file:///' + path) self.widget.show() self.widget.raise_() if float(self.duration) > 0: self.play_timer.setInterval(int(float(self.duration) * 1000)) self.play_timer.start() self.started_signal.emit() @Slot() def stop(self, delete_widget=False): #---- kong ---- if not self.widget: return False super(TextMediaView, self).stop(delete_widget) return True
class WebMediaView_(MediaView): def __init__(self, media, parent): super(WebMediaView_, self).__init__(media, parent) self.widget = QWebEngineView(parent) self.widget.setGeometry(media['geometry']) self.set_default_widget_prop() self.widget.setDisabled(True) @Slot() def play(self): self.finished = 0 url = self.options['uri'] self.widget.load( QUrl.fromPercentEncoding(QByteArray(url.encode('utf-8')))) self.widget.show() self.widget.raise_() if float(self.duration) > 0: self.play_timer.setInterval(int(float(self.duration) * 1000)) self.play_timer.start() self.started_signal.emit() @Slot() def stop(self, delete_widget=False): #---- kong ---- if not self.widget: return False super(WebMediaView_, self).stop(delete_widget) return True
def __init__(self, settings=None): super(Py2WebBrowser, self).__init__() self.pwb = QWebEngineView() self.pwb.setAttribute(Qt.WA_DeleteOnClose, True) if settings is not None: self.bconf = settings else: self.bconf = BaseConfig() self.raw_cookies = [] self.cookie_list = [] self.req_obj = QWebEngineHttpRequest() profile = QWebEngineProfile("pyweb", self.pwb) profile.setHttpUserAgent(random.choice(self.bconf.USER_AGENT_LIST)) cookie_store = profile.cookieStore() cookie_store.cookieAdded.connect(self._on_cookie) wp = QWebEnginePage(profile, self.pwb) self.pwb.setPage(wp) self._settings() self.pwb.show()
class Visual(QWidget): def __init__(self): super(Visual, self).__init__() self.browser = QWebEngineView() self.browser.load(QUrl("www.baidu.com")) layout = QVBoxLayout() layout.addWidget(self.browser) self.setLayout(layout)
def __init__(self, view): super(Page, self).__init__() self.parent = view.parent self.view = view self.result = None self.fullView = QWebEngineView() self.exitFSAction = QAction(self.fullView) self.loop = None
def set_analyzed_license_tab(self): self.remove_analyzed_license_tabs() parsedWebEngineView = QWebEngineView() with open("response.html", "r") as response_file: parsedWebEngineView.setHtml(response_file.read()) self.ui.licenseTabWidget.addTab(parsedWebEngineView, "Analyzed License") self.ui.licenseTabWidget.setCurrentIndex(1)
def render(html: bytes, filename: str): page = QWebEngineView() # printer = QPrinter() # printer.setOutputFileName('/mnt/data/test.pdf') page.loadFinished.connect(lambda self: print_pdf(page, filename)) page.setHtml(html, QUrl('file://')) app.exec_()
class ReverseWidget(ToolWidget): def __init__(self, parent=None): super(ReverseWidget, self).__init__(parent) self.tineye_radio = QRadioButton(self.tr("TinEye")) self.tineye_radio.setIcon(QIcon("icons/tineye.png")) self.google_radio = QRadioButton(self.tr("Google")) self.google_radio.setIcon(QIcon("icons/google.svg")) self.bing_radio = QRadioButton(self.tr("Bing")) self.bing_radio.setIcon(QIcon("icons/bing.svg")) self.root_radio = QRadioButton(self.tr("RootAbout")) self.root_radio.setIcon(QIcon("icons/rootabout.png")) self.karma_radio = QRadioButton(self.tr("KarmaDecay")) self.karma_radio.setIcon(QIcon("icons/karmadecay.jpg")) self.tineye_radio.setChecked(True) self.last_radio = self.tineye_radio self.web_view = QWebEngineView() self.choose() self.tineye_radio.clicked.connect(self.choose) self.google_radio.clicked.connect(self.choose) self.bing_radio.clicked.connect(self.choose) self.root_radio.clicked.connect(self.choose) self.karma_radio.clicked.connect(self.choose) top_layout = QHBoxLayout() top_layout.addWidget(QLabel(self.tr("Search engine:"))) top_layout.addWidget(self.tineye_radio) top_layout.addWidget(self.google_radio) top_layout.addWidget(self.bing_radio) top_layout.addWidget(self.root_radio) top_layout.addWidget(self.karma_radio) top_layout.addStretch() main_layout = QVBoxLayout() main_layout.addLayout(top_layout) main_layout.addWidget(self.web_view) self.setLayout(main_layout) def choose(self): if self.tineye_radio.isChecked(): self.web_view.load(QUrl("https://tineye.com/")) self.last_radio = self.tineye_radio elif self.google_radio.isChecked(): self.web_view.load(QUrl("https://www.google.com/imghp")) self.last_radio = self.google_radio elif self.bing_radio.isChecked(): self.web_view.load( QUrl("https://www.bing.com/?scope=images&nr=1&FORM=NOFORM")) self.last_radio = self.bing_radio elif self.root_radio.isChecked(): self.web_view.load(QUrl("http://rootabout.com/")) self.last_radio = self.root_radio elif self.karma_radio.isChecked(): self.web_view.load(QUrl("http://karmadecay.com/")) self.last_radio = self.karma_radio else: self.last_radio.setChecked(True)
def __init__(self): super().__init__() self.webView = QWebEngineView() layout = QGridLayout() layout.addWidget(self.webView, 0, 0) self.setLayout(layout) self.json_data = '' self.plot_type = 'Regressão' self.webView.page().profile().downloadRequested.connect(self.download_handler)
def __init__(self, parent=None): QWebEngineView.__init__(self, parent) self.channel = QWebChannel(self) self.document = MarkdownDocument() self.channel.registerObject("content", self.document) self.page().setWebChannel(self.channel) self.setUrl("qrc:/index.html")
def __init__(self): super().__init__() self.browser = QWebEngineView() self.browser.setUrl(QUrl("https://www.google.com")) self.setCentralWidget(self.browser) self.show()
def __controls(self): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "test2.html") print(path) #html = open('test2.html', 'r').read() self.browser = QWebEngineView() self.browser.setPage(WebPage(self.browser)) #self.browser.load(QUrl.fromLocalFile(path)) self.browser.load(QUrl("http://localhost:5000"))
def __init__(self, container): QWidget.__init__(self, container) PageSignal.changed.connect(self.render) self.view = QWebEngineView() self.layout = QVBoxLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.view) self.setLayout(self.layout)
def __init__(self): QWidget.__init__(self) self.webView = QWebEngineView() self.webView.load("https://www.messenger.com/login") self.layout = QVBoxLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.layout.addWidget(self.webView) self.setLayout(self.layout)
def __init__(self): super(MainWindow, self).__init__() self.setWindowTitle('PySide2 WebEngineWidgets Example') self.toolBar = QToolBar() self.addToolBar(self.toolBar) self.backButton = QPushButton() self.backButton.setIcon(QIcon(':/qt-project.org/styles/commonstyle/images/left-32.png')) self.backButton.clicked.connect(self.back) self.toolBar.addWidget(self.backButton) self.forwardButton = QPushButton() self.forwardButton.setIcon(QIcon(':/qt-project.org/styles/commonstyle/images/right-32.png')) self.forwardButton.clicked.connect(self.forward) self.toolBar.addWidget(self.forwardButton) self.addressLineEdit = QLineEdit() self.addressLineEdit.returnPressed.connect(self.load) self.toolBar.addWidget(self.addressLineEdit) self.webEngineView = QWebEngineView() self.setCentralWidget(self.webEngineView) initialUrl = 'http://qt.io' self.addressLineEdit.setText(initialUrl) self.webEngineView.load(QUrl(initialUrl)) self.webEngineView.page().titleChanged.connect(self.setWindowTitle) self.webEngineView.page().urlChanged.connect(self.urlChanged)
def __init__(self, parent=None): super(HelpWindow,self).__init__(parent) self.setWindowTitle("Facepager 3.0 - Help") self.setMinimumWidth(600); self.setMinimumHeight(600); central = QWidget() self.setCentralWidget(central) vLayout = QVBoxLayout(central) self.page = MyQWebEnginePage() self.browser = QWebEngineView(central) self.browser.setPage(self.page) vLayout.addWidget(self.browser) hLayout = QHBoxLayout() vLayout.addLayout(hLayout) hLayout.addStretch(5) dismiss = QPushButton(central) dismiss.setText("Close") dismiss.clicked.connect(self.hide) hLayout.addWidget(dismiss)
class MainWindow(QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.setWindowTitle('PySide2 WebEngineWidgets Example') self.toolBar = QToolBar() self.addToolBar(self.toolBar) self.backButton = QPushButton() self.backButton.setIcon(QIcon(':/qt-project.org/styles/commonstyle/images/left-32.png')) self.backButton.clicked.connect(self.back) self.toolBar.addWidget(self.backButton) self.forwardButton = QPushButton() self.forwardButton.setIcon(QIcon(':/qt-project.org/styles/commonstyle/images/right-32.png')) self.forwardButton.clicked.connect(self.forward) self.toolBar.addWidget(self.forwardButton) self.addressLineEdit = QLineEdit() self.addressLineEdit.returnPressed.connect(self.load) self.toolBar.addWidget(self.addressLineEdit) self.webEngineView = QWebEngineView() self.setCentralWidget(self.webEngineView) initialUrl = 'http://qt.io' self.addressLineEdit.setText(initialUrl) self.webEngineView.load(QUrl(initialUrl)) self.webEngineView.page().titleChanged.connect(self.setWindowTitle) self.webEngineView.page().urlChanged.connect(self.urlChanged) def load(self): url = QUrl.fromUserInput(self.addressLineEdit.text()) if url.isValid(): self.webEngineView.load(url) def back(self): self.webEngineView.page().triggerAction(QWebEnginePage.Back) def forward(self): self.webEngineView.page().triggerAction(QWebEnginePage.Forward) def urlChanged(self, url): self.addressLineEdit.setText(url.toString())
iHost["ip"], iHost["mac"], get_hostname(iHost["ip"])) query += "');" web.page().runJavaScript(query) def loadfinished(aIsOk): #load jQuery stuff with open("extern/jquery-min.js", "r") as jqFile: content = jqFile.read() content += "\nvar qt = { 'jQuery': jQuery.noConflict(true) };" web.page().runJavaScript(content) fill_web_table() web.page().runJavaScript("qt.jQuery('#content_table tr:last').after('<tr><td>bla2a</td></tr>');") if __name__ == '__main__': # Create the Qt Application app = QApplication(sys.argv) web = QWebEngineView() web.setHtml(WEBVIEW_CONTENT_SKELETON) web.loadFinished.connect(loadfinished) # Run the main Qt loop web.show() sys.exit(app.exec_())