快速获取多个页面

mucri的Python项目详细描述


穆克里

使用pythonasyncio快速获取许多页面/api。

安装

Only python 3.6+

pip isntall mucri

用法

fetch_pages接受两个参数:

links:要获取的链接列表(下面的示例) concurrency:一次要发送多少请求(默认为20)

frommucriimportfetch_pages# links can be a single string or a dict with specific instructionslinks=["http://meain.github.io",# Can be just a url{"url":"http://somelink"},# or a dict with url key{# for more complex stuff"url":"http://fakelink","action":"get",# get | post"data":{},"headers":{},"resp_type":"text",# text | json | image}]results=fetch_pages(links)# fetches all of them asynchronously

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
文件名的java正则表达式限制名称大小和文件扩展名   Mac上的java Android SDK:jspawnhelper意外退出   java SQL Server 2000到Oracle 12c重音字符   在Java中快速比较大数据集中的值和小数据集中的值   java在代码中的许多地方保留对对象的引用   Java规范中私有内部类的jvm访问标志与反射API不一致?   比较2个int数组中匹配的数字   java Apache Commons数学简化回归:get prediction stderr   安卓 Java SDK管理器因命令行输出中的“flashplayerplugin”而崩溃   JavaSQLite:关闭DB时必须关闭游标吗?   泛型Java设计抽象类声明示例说明   java应用程序在添加片段时崩溃   如何在java中使用注释为字段加载值