百度智能小程序 在元素范圍內(nèi)獲取元素?cái)?shù)組

2020-09-05 15:10 更新

element.$$

解釋:在元素范圍內(nèi)獲取元素?cái)?shù)組。

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

參數(shù)說明:

屬性名類型必填默認(rèn)值說明
selectorString-選擇器

示例代碼:

automator.launch().then(async smartProgram => {
    const page = await smartProgram.reLaunch('/pages/api/api');
    const element = await page.$('.group');
    const res = await element.$$('.group-bd');
    console.log(res.length);
});


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)