首页 > 其他 > 详细

Pyqt5自定义浏览器

时间:2019-02-27 22:48:44      阅读:416      评论:0      收藏:0      [点我收藏+]
from PyQt5.QtWebChannel import QWebChannel
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtCore import QUrl
from interactive import JavascriptBridge


class Browser(QWebEngineView):
    def __init__(self, *args, **kwargs):
        super(Browser, self).__init__(*args, **kwargs)
        self.pWebChannel = QWebChannel(self)
        self.js_bridge = JavascriptBridge(self)
        self.pWebChannel.registerObject("interactObj", self.js_bridge)
        self.page().setWebChannel(self.pWebChannel)
        # self.url = "https://wx5ec53535eb20a118.wx.qmgkj.cn/activity/dev/slider/#/record"
        self.url = "https://baidu.com"
        self.page().load(QUrl(self.url))

 

Pyqt5自定义浏览器

原文:https://www.cnblogs.com/li1992/p/10447528.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!