element.$

解释:在元素范围内获取元素。

  1. element.$(selector: string): Promise<Element>

参数说明

属性名类型必填默认值说明
selectorString-选择器

示例代码

  1. automator.launch().then(async smartProgram => {
  2. const page = await smartProgram.reLaunch('/pages/api/api');
  3. const element = await page.$('.group-bd');
  4. const logo = await element.$('.item-logo');
  5. });