🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@iflyrpa/playwright

Package Overview
Dependencies
Maintainers
1
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iflyrpa/playwright

iflyrpa 封装的一组特定场景的自动化脚本,支持的场景如下:

latest
npmnpm
Version
4.0.1
Version published
Weekly downloads
1.5K
413.78%
Maintainers
1
Weekly downloads
 
Created
Source

@iflyrpa/playwright

iflyrpa 封装的一组特定场景的自动化脚本,支持的场景如下:

平台脚本说明支持的方式
头条toutiaoPublish发布/保存草稿Mock Api / RPA
头条getToutiaoConfig获取头条发布配置的话题信息、位置信息和原创首发信息Mock Api
头条searchToutiaoTopicList搜索头条话题Mock Api
微头条weitoutiaoPublish发布Mock Api / RPA
百家号getBaijiahaoActivity查询百家号活动投稿Mock Api
百家号getBaijiahaoConfig获取百家号发布的设置信息Mock Api / RPA
百家号baijiahaoPublish发布/保存草稿Mock Api / RPA
微信公众号(小绿书-图文模式)weixinmpPublish发布Mock Api / RPA
微信公众号weixinPublish发布Mock Api
小红书xiaohongshuPublish发布Mock Api / RPA
小红书searchXiaohongshuTopicList搜索小红书话题Mock Api
小红书searchXiaohongshuLocation搜索小红书地址Mock Api

安装

# npm
npm i @iflyrpa/playwright

# yarn
yarn add @iflyrpa/playwright

# pnpm
pnpm install @iflyrpa/playwright

使用方法

import { RpaTask } from "@iflyrpa/playwright";

//  1. 创建缓存目录
const cachePath = join(__dirname, "../main/cache");

// 2. 初始化
const automateTask = new RpaTask({
  cachePath, // 缓存目录
  debug: true, // debug 模式下可视化展示所有操作
  forceUpdate: false, // 是否使用远程最新版本
  user: { id: "xx", email: "xx@xx.com" }, // 用户信息
  enverionment: "development", // 环境变量(主要用于在日志中区分环境)
});

// 3. 执行脚本,支持的脚本如上
automateTask.actions.xiaohongshuPublish(xiaohonshuPublishParams)

// 4. 应用关闭前,清除副作用
app.on("before-quit", (event) => {
 if (!automateTask.isClosed) {
  // 阻止应用立即退出
  event.preventDefault();

  automateTask.close().finally(() => {
   console.log("close app");
   app.quit();
  });
 }
});

注意事项

1. 缓存目录包含以下文件:

  • packages:运行时依赖和脚本缓存目录
  • tmp:运行时缓存目录
  • rpa.log:运行日志文件

2. 如何获取脚本入参类型:

import type { ActionMethodParams } from "@iflyrpa/playwright";

export const xiaohonshuPublishParams: ActionMethodParams['xiaohongshuPublish'] = {}

automateTask.actions.xiaohongshuPublish(xiaohonshuPublishParams)

FAQs

Package last updated on 25 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts