I am trying to select a drop-down menu but there is no id to select. How can I make the selection and then the follow-up selection? In this case, I need to select All Transactions and then All tolls. Thank you for all the help.
//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', 'Rosariofamily');
await page.type('#passwordTxtBox', 'R00tbeer');
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()