文章封面:
点击事件
const actions = [
{
"step_name": "1. 点击首页入口",
"type": "click",
"selector": "html > body > div:nth-of-type(2) > div > div > div > main > div:nth-of-type(1) > div > div:nth-of-type(3) > div > a:nth-of-type(1)",
"url_keyword": "123.com"
},
];
具体的含义:
- selector: 表示css选择器,油猴脚本通过这种方式来寻找需要点击的地址。
你可以从 "开发者工具(F12)", 邮件点击一个元素,然后选择 "copy"->"Copy full XPath" 来获取到该元素的相应地址。这样主要是因为元素没有唯一的 id 等能够定位,所以只能使用这种方法。 - url_keyword: 这是一个 条件判断 或 触发器。他的作用是告诉油猴脚本:"只有在当天网页的URL地址中包含
123.com这个关键词时,才执行这一步操作。"