有什么方法可以在浏览器的Pyqt5中获取页面的类吗? [英] Is there any way to get class of the page in Pyqt5 in browser?

查看:418
本文介绍了有什么方法可以在浏览器的Pyqt5中获取页面的类吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用pyqt5.我希望用户单击应该嵌入在pyqt5应用程序中的浏览器,以获取他/她正在单击的元素的类.

I am working with pyqt5. I want the user to click on the browser which should be embeded on my pyqt5 application to get the Class of the element which he/she is clicking on it.

我刚刚在堆栈溢出中发现,通过将javascript代码与python结合使用是可行的.任何想法如何提取元素的类?

I just found on stack overflow that it's doable by combining javascript code with python. Any idea how to extract the class of the element?

推荐答案

解决方案是添加一个事件侦听器",以使DOM对象与(Py)Qt之间的通信成为可能.

The solution is to add an "event listener" that makes possible communication between the DOM objects and (Py)Qt.

以下解决方案基于

这篇关于有什么方法可以在浏览器的Pyqt5中获取页面的类吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆