Part class

This commit is contained in:
2022-02-15 22:51:38 +03:00
parent efafcbc356
commit d47a4c634e
3 changed files with 23 additions and 8 deletions

15
items/Part.js Normal file
View File

@@ -0,0 +1,15 @@
module.exports = class Part {
constructor (set, part) {
this.part = part
this.url = `${set}_prime_${part}`
}
async getPrice (page) {
const marketUrl = 'https://warframe.market/items/'
await page.goto(marketUrl + this.url)
const element = await page.waitForSelector('b.price')
const value = await element.evaluate(el => el.textContent)
return Number(value)
}
}