This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
const Api = require('../api')
|
||||
|
||||
module.exports = class Part {
|
||||
constructor (set, part, amount) {
|
||||
this.part = part
|
||||
@@ -5,12 +7,8 @@ module.exports = class Part {
|
||||
this.amount = amount ?? 1
|
||||
}
|
||||
|
||||
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) * this.amount
|
||||
async getPrice () {
|
||||
const orders = await Api.getSortedOrders(this.url)
|
||||
return Number(orders[0].platinum) * this.amount
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user