for(this.currentCategory of this.categories) {
await this.driver.get(this.currentCategory.url)
const lastPageLink = await this.driver.findElement(By.css('.pager-last a'))
let count_pages = +lastPageLink.getText()
if (count_pages !== count_pages) {
rl.question('Не нашли количество страниц. Установите вручную ', async (value) => {
count_pages = value
rl.close()
await this.parseCategory(count_pages)
})
} else {
await this.parseCategory(count_pages)
}
}
await this.stop()