Estoy tratando de seleccionar un menú desplegable, pero no hay una identificación para seleccionar. ¿Cómo puedo hacer la selección y luego la selección de seguimiento? En este caso, debo seleccionar Todas las transacciones y luego Todos los peajes. Gracias por toda la ayuda.
//From first drop down <div _ngcontent-mxw-c311="" ngclass.lt-md="filterItem" class="filterItem ng-star-inserted" style="margin-right: 10px;"> <ng-component _nghost-mxw-c298="" class="ng-star-inserted"> <div _ngcontent-mxw-c298="" fxlayout="column" fxlayoutalign="start start" style="flex-direction: column; box-sizing: border-box; display: flex; place-content: flex-start; align-items: flex-start;"> <div _ngcontent-mxw-c298="" fxlayout="row" fxlayoutalign="space-between center" cdkoverlayorigin="" class="criteria-shape criteria-color criteria-size criteria-text criteria-hover" style="flex-direction: row; box-sizing: border-box; display: flex; place-content: center space-between; align-items: center;"> //What is highlighted when I do an inspect <span _ngcontent-mxw-c298="" style="color: #007aff; font-size: 14px;"> All Transactions </span> <div _ngcontent-mxw-c298="" class="glyphicon glyphicon-chevron-down chevron-color chevron-adjustment ng-star-inserted"> </div> <!----> </div> <!----> <!----> </div> </ng-component> <!----> </div> //From the drop down I need to select <div _ngcontent-mxw-c298="" fxlayout="column" fxlayoutalign="start start" class="ng-star-inserted" style="flex-direction: column; box-sizing: border-box; display: flex; place-content: flex-start; align-items: flex-start;"> <div _ngcontent-mxw-c298="" class="transactionType-text criteria-hover"> //What is highlighted when I do an inspect <span _ngcontent-mxw-c298="" class="parentItem"> All Tolls</span> </div> </div> const puppeteer = require ('puppeteer'); async function start(){ const browser = await puppeteer.launch({ headless: false}); const page = await browser.newPage(); await page.goto("https://www.hctra.org/Login"); await page.waitForSelector('#usernameTxtBox'); await page.type('#usernameTxtBox', 'xxxxxxx'); await page.type('#passwordTxtBox', 'xxxxxx'); await page.click('.btn.u-spacing--widthFill'); await page.waitForNavigation(); await page.goto("https://www.hctra.org/AccountActivity"); await page.$('[name="All Transactions"]'); await page.select ("All Transactions", "All Tolls"); await page.screenshot({path: "Reservation.png"}); await browser.close(); } start()