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

View File

@@ -1,8 +1,5 @@
const puppeteer = require('puppeteer')
const getPrice = require('./getPrice')
const items = require('./items')
const marketUrl = 'https://warframe.market/items/';
const items = require('./items');
(async () => {
const browser = await puppeteer.launch({ headless: false })
@@ -11,10 +8,10 @@ const marketUrl = 'https://warframe.market/items/';
for (const item of items) {
let partsPrice = 0
for (const part of item.parts) {
partsPrice += await getPrice(page, marketUrl + part.url)
partsPrice += await part.getPrice(page)
}
const setPrice = await getPrice(page, marketUrl + item.url)
const setPrice = await item.set.getPrice(page)
if (partsPrice < setPrice) {
console.log(item.name, partsPrice, setPrice)
}