Skip to content

无意中接触到Automa这款浏览器插件,属实厉害了!它是一款打造自动化Workflow的浏览器插件,代替人进行一些自动化操作,包括填写表单、自动提交、网页截图、爬取数据等等,可以充分发挥想象力做出一些有用的东西来。

github官网:https://github.com/automaapp/automa

使用文档:Getting started | Automa Docs

B站优质教程合集:何止编程的个人空间_哔哩哔哩_bilibili

作者更新非常勤快,是个好东西,写本文的时候是1.27版本,本文只做抛砖引玉的作用,感兴趣的同学可以自己探索,学习的时候主要是看官网使用文档,还是很详细的,基本没有阅读障碍。

界面简介

image-20230129194731427

基本概念

1. block

Automa中每一个功能模块称为一个block,一个block就是一个节点,我们需要做的就是编排这些节点,目前有六种类型的block

  • General: Perform a general action in the workflow, like making an HTTP request or executing another workflow.
  • Browser: To control the browser.
  • Web Interaction: To interact with the active tab of the workflow. Before using blocks in this category, you need to use a New Tab or Active Tab block.
  • Control Flow: Add logic to the workflow.
  • Online Services: Services that integrate with Automa.
  • Data: Modify or manipulate workflow variables or tables.

2. variables

变量,存储单个数据,怎么拿到变量数据呢,在不同的场景有不同的方式。

- 在block中想要拿到变量,使用{{variables.xxx}}的方式

- 在`javascript`代码块中想要拿到变量,通过automaRefData(keyword, path)的方式
js
// Get the value of the "text" variable
const value = automaRefData('variables', 'text');

3. table

表,存储多行数据,暂时还没用过。

4. parameters

参数,我们在开启一个workflow的时候,可以填入一些参数供以后所有的workflow使用,相当于一个全局变量,使用时再Trigger这个block上进行设置,这样开启workflow时就会弹出一个form表单给我们填写相应的参数,这个参数将被加载到variables变量上,获取方式和variables一样。

image-20230130072032212

image-20230130072108920

常用block

见官网,实践出真知

Released under the MIT License.