2018-12-26 23:04:56 +08:00
|
|
|
# QWebEngineView
|
|
|
|
|
2019-03-12 12:47:56 +08:00
|
|
|
- 目录
|
|
|
|
- [获取Cookie](#1、获取Cookie)
|
2019-04-27 16:47:05 +08:00
|
|
|
- [和Js交互操作](#2、和Js交互操作)
|
2019-03-12 12:47:56 +08:00
|
|
|
|
2019-03-12 00:08:16 +08:00
|
|
|
## 1、获取Cookie
|
2018-12-26 23:04:56 +08:00
|
|
|
[运行 GetCookie.py](GetCookie.py)
|
|
|
|
|
|
|
|
通过`QWebEngineProfile`中得到的`cookieStore`并绑定它的`cookieAdded`信号来得到Cookie
|
|
|
|
|
2019-04-27 16:47:05 +08:00
|
|
|
![GetCookie](ScreenShot/GetCookie.png)
|
|
|
|
|
|
|
|
## 2、和Js交互操作
|
|
|
|
[运行 JsSignals.py](JsSignals.py)
|
|
|
|
|
|
|
|
通过`qwebchannel.js`和`QWebChannel.registerObject`进行Python对象和Javascript的交互
|
|
|
|
|
|
|
|
具体看代码中的注释
|
|
|
|
|
|
|
|
![JsSignals](ScreenShot/JsSignals.gif)
|