StiliyanKushev / csgo-tradeup-cli

A Command Line Tool for generating profitable CSGO trade-ups using the genetic algorithm.
25 stars 2 forks source link

TypeError: Cannot read properties of undefined (reading 'children') #15

Closed TomiLikesToCode closed 9 months ago

TomiLikesToCode commented 1 year ago

root@osboxes:/home/osboxes/csgo-tradeup-cli# node index --profit 110 --populs 10 --popSize 10 --spy --visualize Database is empty. Building database... Building the database. This may take a few minutes. Ctrl-C to cancel: 5 Ctrl-C to cancel: 4 Ctrl-C to cancel: 3 Ctrl-C to cancel: 2 Ctrl-C to cancel: 1 Clearing the database. Done. file:///home/osboxes/csgo-tradeup-cli/scrape.js:43 let all = [...dom.window.document.getElementsByClassName("navbar-nav")[0].children] ^

TypeError: Cannot read properties of undefined (reading 'children') at getGunsSources (file:///home/osboxes/csgo-tradeup-cli/scrape.js:43:78) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async getGunsData (file:///home/osboxes/csgo-tradeup-cli/scrape.js:64:22) at async updateDatabase (file:///home/osboxes/csgo-tradeup-cli/scrape.js:277:23) at async buildDatabase (file:///home/osboxes/csgo-tradeup-cli/db.js:41:5) at async checkEmptyDB (file:///home/osboxes/csgo-tradeup-cli/db.js:51:9) at async file:///home/osboxes/csgo-tradeup-cli/index.js:21:5

Node.js v18.7.0

Tobz92 commented 1 year ago

For me the same.

TomiLikesToCode commented 1 year ago

I tried multiple machine none of them worked, i wish knew the problem.

seanres commented 1 year ago

The issue is from cloudflare, you need to properly bypass the DDOS protection to get the correct HTML information

TomiLikesToCode commented 1 year ago

How?

sorenba commented 1 year ago

I had the same problem when running using vagrant + virtualbox. When running on native windows it works.

StiliyanKushev commented 9 months ago

Unable to reproduce, closing.