PyQt/QWebView/README.md
2019-05-22 10:49:55 +08:00

30 lines
No EOL
814 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# QWebView
- 目录
- [梦幻树](#1梦幻树)
- [获取Cookie](#2获取Cookie)
- [和Js交互操作](#3和Js交互操作)
## 1、梦幻树
[运行 DreamTree.py](DreamTree.py)
在桌面上显示透明html效果使用`QWebkit`加载html实现,采用窗口背景透明和穿透方式
![DreamTree](ScreenShot/DreamTree.png)
## 2、获取Cookie
[运行 GetCookie.py](GetCookie.py)
从`page()`中得到`QNetworkAccessManager`,在从中得到`QNetworkCookieJar`,
最后得到cookie,当然也可以设置自己的`QNetworkCookieJar`
![GetCookie](ScreenShot/GetCookie.png)
## 3、和Js交互操作
[运行 JsSignals.py](JsSignals.py)
通过`QWebFrame`的`addToJavaScriptWindowObject`函数提供进行Python对象和Javascript的交互
具体看代码中的注释
![JsSignals](ScreenShot/JsSignals.gif)