Closed amkayondo closed 3 years ago
solved it in this way
.evaluate(() => {
const categoryBtn = document.getElementsByClassName(
"postbox-field-dropdown"
);
for (let i = 0; i < categoryBtn.length; i++) {
if (categoryBtn[i].textContent == "Choose category") {
const foundBtn = categoryBtn[i];
return foundBtn.click();
}
}
})
I am trying to use nightmare js to select categories of listing when creating a new post on nextdoor website but I am unable to do so as the buttons have the same class names.
WHAT AM SOLVING