FlowViewer


NameFlowViewer JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://gitee.com/g1879/FlowViewer
SummaryChrome浏览器数据包监听器。
upload_time2023-04-06 03:03:54
maintainer
docs_urlNone
authorg1879
requires_python>=3.6
licenseMIT
keywords flowviewer
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ✨️简介

FlowViewer 是一个基于 python 的 Chrome 浏览器数据包监测器。

它可以异步监听浏览器收发数据,实时返回结果供同步程序使用。

**使用文档:** 📒[点击打开](http://g1879.gitee.io/flowviewer)

**联系邮箱:**  g1879@qq.com

**QQ群:** 897838127

# 📕背景

许多网页的数据来自接口,在网站使用过程中动态加载,如使用 JS 加载内容的翻页列表。

这些数据通常以 json 形式发送,浏览器接收后,对其进行解析,再加载到 DOM 相应位置。

做数据采集的时候,我们往往从 DOM 中去获取解析后数据的,可能存在数据不全、加载响应不及时、难以判断加载完成等问题。

使用本库,可把自动化与数据包检测结合起来,通过网络数据状况配合操作动作,使开发更便利,程序可靠性更高,设计空间更广阔。

# 🍀 特性

- 轻便,使用简单

- 无侵入式检测,手动、自动程序都可使用

- 可设置检测目标、数量、时间

- 可同步使用检测到的数据

- 可自动搜索 Chrome 进程,便于监听 selenium 打开的未知端口浏览器

# 🎇简单示例

这个示例简单介绍一下监听器的工作方式,具体用法看后面的章节。

这是最简单的使用场景,使用监听器对 9222 端口的浏览器进行监听,不设置筛选条件,不使用自动化。人工操作浏览器,并把所有流过浏览器的数据包的 url 属性打印出来。这段程序是那么简单,甚至没有设置停止条件,所以不会自动停止。

```python
from FlowViewer import Listener

listener =Listener(9222)  # 创建监听器,监听9222端口的浏览器
listener.listen()  # 开始监听,不设置目标,无限制监听

for data in listener.steps():  # 遍历所有监听到的数据包
    print(data.url)  # 实时打印监听到的内容
```

# 🛠使用方法

[点击跳转到使用手册](http://g1879.gitee.io/flowviewer)

# 🖐🏻 免责声明

请勿将 FlowViewer 应用到任何可能会违反法律规定和道德约束的工作中,请友善使用 FlowViewer,遵守蜘蛛协议,不要将 FlowViewer 用于任何非法用途。如您选择使用 FlowViewer 即代表您遵守此协议,作者不承担任何由于您违反此协议带来任何的法律风险和损失,一切后果由您承担。

# ☕ 请我喝咖啡

如果本项目对您有所帮助,不妨请作者我喝杯咖啡 :)

![](https://gitee.com/g1879/DrissionPage-demos/raw/master/pics/code.jpg)

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitee.com/g1879/FlowViewer",
    "name": "FlowViewer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "FlowViewer",
    "author": "g1879",
    "author_email": "g1879@qq.com",
    "download_url": "https://files.pythonhosted.org/packages/5b/1d/e1514ee861e96261a904c040226dee2d1043ebdb976c99c44fb81eefbabf/FlowViewer-0.3.0.tar.gz",
    "platform": null,
    "description": "# \u2728\ufe0f\u7b80\u4ecb\r\n\r\nFlowViewer \u662f\u4e00\u4e2a\u57fa\u4e8e python \u7684 Chrome \u6d4f\u89c8\u5668\u6570\u636e\u5305\u76d1\u6d4b\u5668\u3002\r\n\r\n\u5b83\u53ef\u4ee5\u5f02\u6b65\u76d1\u542c\u6d4f\u89c8\u5668\u6536\u53d1\u6570\u636e\uff0c\u5b9e\u65f6\u8fd4\u56de\u7ed3\u679c\u4f9b\u540c\u6b65\u7a0b\u5e8f\u4f7f\u7528\u3002\r\n\r\n**\u4f7f\u7528\u6587\u6863\uff1a** \ud83d\udcd2[\u70b9\u51fb\u6253\u5f00](http://g1879.gitee.io/flowviewer)\r\n\r\n**\u8054\u7cfb\u90ae\u7bb1\uff1a**  g1879@qq.com\r\n\r\n**QQ\u7fa4\uff1a**\u00a0897838127\r\n\r\n# \ud83d\udcd5\u80cc\u666f\r\n\r\n\u8bb8\u591a\u7f51\u9875\u7684\u6570\u636e\u6765\u81ea\u63a5\u53e3\uff0c\u5728\u7f51\u7ad9\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u52a8\u6001\u52a0\u8f7d\uff0c\u5982\u4f7f\u7528 JS \u52a0\u8f7d\u5185\u5bb9\u7684\u7ffb\u9875\u5217\u8868\u3002\r\n\r\n\u8fd9\u4e9b\u6570\u636e\u901a\u5e38\u4ee5 json \u5f62\u5f0f\u53d1\u9001\uff0c\u6d4f\u89c8\u5668\u63a5\u6536\u540e\uff0c\u5bf9\u5176\u8fdb\u884c\u89e3\u6790\uff0c\u518d\u52a0\u8f7d\u5230 DOM \u76f8\u5e94\u4f4d\u7f6e\u3002\r\n\r\n\u505a\u6570\u636e\u91c7\u96c6\u7684\u65f6\u5019\uff0c\u6211\u4eec\u5f80\u5f80\u4ece DOM \u4e2d\u53bb\u83b7\u53d6\u89e3\u6790\u540e\u6570\u636e\u7684\uff0c\u53ef\u80fd\u5b58\u5728\u6570\u636e\u4e0d\u5168\u3001\u52a0\u8f7d\u54cd\u5e94\u4e0d\u53ca\u65f6\u3001\u96be\u4ee5\u5224\u65ad\u52a0\u8f7d\u5b8c\u6210\u7b49\u95ee\u9898\u3002\r\n\r\n\u4f7f\u7528\u672c\u5e93\uff0c\u53ef\u628a\u81ea\u52a8\u5316\u4e0e\u6570\u636e\u5305\u68c0\u6d4b\u7ed3\u5408\u8d77\u6765\uff0c\u901a\u8fc7\u7f51\u7edc\u6570\u636e\u72b6\u51b5\u914d\u5408\u64cd\u4f5c\u52a8\u4f5c\uff0c\u4f7f\u5f00\u53d1\u66f4\u4fbf\u5229\uff0c\u7a0b\u5e8f\u53ef\u9760\u6027\u66f4\u9ad8\uff0c\u8bbe\u8ba1\u7a7a\u95f4\u66f4\u5e7f\u9614\u3002\r\n\r\n# \ud83c\udf40 \u7279\u6027\r\n\r\n- \u8f7b\u4fbf\uff0c\u4f7f\u7528\u7b80\u5355\r\n\r\n- \u65e0\u4fb5\u5165\u5f0f\u68c0\u6d4b\uff0c\u624b\u52a8\u3001\u81ea\u52a8\u7a0b\u5e8f\u90fd\u53ef\u4f7f\u7528\r\n\r\n- \u53ef\u8bbe\u7f6e\u68c0\u6d4b\u76ee\u6807\u3001\u6570\u91cf\u3001\u65f6\u95f4\r\n\r\n- \u53ef\u540c\u6b65\u4f7f\u7528\u68c0\u6d4b\u5230\u7684\u6570\u636e\r\n\r\n- \u53ef\u81ea\u52a8\u641c\u7d22 Chrome \u8fdb\u7a0b\uff0c\u4fbf\u4e8e\u76d1\u542c selenium \u6253\u5f00\u7684\u672a\u77e5\u7aef\u53e3\u6d4f\u89c8\u5668\r\n\r\n# \ud83c\udf87\u7b80\u5355\u793a\u4f8b\r\n\r\n\u8fd9\u4e2a\u793a\u4f8b\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0b\u76d1\u542c\u5668\u7684\u5de5\u4f5c\u65b9\u5f0f\uff0c\u5177\u4f53\u7528\u6cd5\u770b\u540e\u9762\u7684\u7ae0\u8282\u3002\r\n\r\n\u8fd9\u662f\u6700\u7b80\u5355\u7684\u4f7f\u7528\u573a\u666f\uff0c\u4f7f\u7528\u76d1\u542c\u5668\u5bf9 9222 \u7aef\u53e3\u7684\u6d4f\u89c8\u5668\u8fdb\u884c\u76d1\u542c\uff0c\u4e0d\u8bbe\u7f6e\u7b5b\u9009\u6761\u4ef6\uff0c\u4e0d\u4f7f\u7528\u81ea\u52a8\u5316\u3002\u4eba\u5de5\u64cd\u4f5c\u6d4f\u89c8\u5668\uff0c\u5e76\u628a\u6240\u6709\u6d41\u8fc7\u6d4f\u89c8\u5668\u7684\u6570\u636e\u5305\u7684 url \u5c5e\u6027\u6253\u5370\u51fa\u6765\u3002\u8fd9\u6bb5\u7a0b\u5e8f\u662f\u90a3\u4e48\u7b80\u5355\uff0c\u751a\u81f3\u6ca1\u6709\u8bbe\u7f6e\u505c\u6b62\u6761\u4ef6\uff0c\u6240\u4ee5\u4e0d\u4f1a\u81ea\u52a8\u505c\u6b62\u3002\r\n\r\n```python\r\nfrom FlowViewer import Listener\r\n\r\nlistener =Listener(9222)  # \u521b\u5efa\u76d1\u542c\u5668\uff0c\u76d1\u542c9222\u7aef\u53e3\u7684\u6d4f\u89c8\u5668\r\nlistener.listen()  # \u5f00\u59cb\u76d1\u542c\uff0c\u4e0d\u8bbe\u7f6e\u76ee\u6807\uff0c\u65e0\u9650\u5236\u76d1\u542c\r\n\r\nfor data in listener.steps():  # \u904d\u5386\u6240\u6709\u76d1\u542c\u5230\u7684\u6570\u636e\u5305\r\n    print(data.url)  # \u5b9e\u65f6\u6253\u5370\u76d1\u542c\u5230\u7684\u5185\u5bb9\r\n```\r\n\r\n# \ud83d\udee0\u4f7f\u7528\u65b9\u6cd5\r\n\r\n[\u70b9\u51fb\u8df3\u8f6c\u5230\u4f7f\u7528\u624b\u518c](http://g1879.gitee.io/flowviewer)\r\n\r\n# \ud83d\udd90\ud83c\udffb \u514d\u8d23\u58f0\u660e\r\n\r\n\u8bf7\u52ff\u5c06 FlowViewer \u5e94\u7528\u5230\u4efb\u4f55\u53ef\u80fd\u4f1a\u8fdd\u53cd\u6cd5\u5f8b\u89c4\u5b9a\u548c\u9053\u5fb7\u7ea6\u675f\u7684\u5de5\u4f5c\u4e2d,\u8bf7\u53cb\u5584\u4f7f\u7528 FlowViewer\uff0c\u9075\u5b88\u8718\u86db\u534f\u8bae\uff0c\u4e0d\u8981\u5c06 FlowViewer \u7528\u4e8e\u4efb\u4f55\u975e\u6cd5\u7528\u9014\u3002\u5982\u60a8\u9009\u62e9\u4f7f\u7528 FlowViewer \u5373\u4ee3\u8868\u60a8\u9075\u5b88\u6b64\u534f\u8bae\uff0c\u4f5c\u8005\u4e0d\u627f\u62c5\u4efb\u4f55\u7531\u4e8e\u60a8\u8fdd\u53cd\u6b64\u534f\u8bae\u5e26\u6765\u4efb\u4f55\u7684\u6cd5\u5f8b\u98ce\u9669\u548c\u635f\u5931\uff0c\u4e00\u5207\u540e\u679c\u7531\u60a8\u627f\u62c5\u3002\r\n\r\n# \u2615 \u8bf7\u6211\u559d\u5496\u5561\r\n\r\n\u5982\u679c\u672c\u9879\u76ee\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff0c\u4e0d\u59a8\u8bf7\u4f5c\u8005\u6211\u559d\u676f\u5496\u5561 \uff1a\uff09\r\n\r\n![](https://gitee.com/g1879/DrissionPage-demos/raw/master/pics/code.jpg)\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Chrome\u6d4f\u89c8\u5668\u6570\u636e\u5305\u76d1\u542c\u5668\u3002",
    "version": "0.3.0",
    "split_keywords": [
        "flowviewer"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20348ae6f8a0367fb1a7ac16ba7383ddfc6c4f01f222fa3e83415d43a5fcd807",
                "md5": "a7547c6315b1e6b92216e1b8235119a0",
                "sha256": "2c847c79dfed221bb27f467b37162cf55257488690dc4cf97910e2c945376b9c"
            },
            "downloads": -1,
            "filename": "FlowViewer-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a7547c6315b1e6b92216e1b8235119a0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 14575,
            "upload_time": "2023-04-06T03:03:52",
            "upload_time_iso_8601": "2023-04-06T03:03:52.578572Z",
            "url": "https://files.pythonhosted.org/packages/20/34/8ae6f8a0367fb1a7ac16ba7383ddfc6c4f01f222fa3e83415d43a5fcd807/FlowViewer-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5b1de1514ee861e96261a904c040226dee2d1043ebdb976c99c44fb81eefbabf",
                "md5": "ef5076bf4ddb77e260b5456ff8bc41dc",
                "sha256": "a04a99fbd9eac64789393207eeca1ca373c0f20cf22c755ab89f04f88b2b2bf5"
            },
            "downloads": -1,
            "filename": "FlowViewer-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ef5076bf4ddb77e260b5456ff8bc41dc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 9928,
            "upload_time": "2023-04-06T03:03:54",
            "upload_time_iso_8601": "2023-04-06T03:03:54.845158Z",
            "url": "https://files.pythonhosted.org/packages/5b/1d/e1514ee861e96261a904c040226dee2d1043ebdb976c99c44fb81eefbabf/FlowViewer-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-06 03:03:54",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "flowviewer"
}
        
Elapsed time: 0.06035s