jeroentvb / wind-scrape

Node package for scraping wind forecast from a few websites
GNU General Public License v3.0
30 stars 4 forks source link

Windguru default model #49

Closed stefano-gentile closed 2 years ago

stefano-gentile commented 2 years ago

Hey! Amazing app. I'm, trying to retrieve the default model which appairs at first, is that possible?

Thanks

jeroentvb commented 2 years ago

I'm, trying to retrieve the default model which appairs at first

I'm assuming you mean the 'WG' model. Scraping that model is currently not possible with wind-scrape, because it uses windguru micro, and windguru micro doesn't include the WG model. All currently scrapable models are listed on the windguru micro help page.

Wind-scrape uses windguru micro because it serves static html pages which make scraping a lot faster and easier. The normal website dynamically loads content, so one would need to use a headless browser to wait for the content to load and then scrape, instead of simply fetching a html file.

It is certainly possible to scrape the WG model, but would require the use of a headless browser, to:

  1. Log in (otherwise you don't get the personalized model values)
  2. Wait for the content to load and scrape it

So while it is possible, it's quite a bit of work to build the feature. I'm currently not interested in building it. You're welcome to submit a PR.

stefano-gentile commented 2 years ago

Thanks for that detailed explanation. I didn't know about those requisites to scrape the WG model, currently I'm in a learning curve, I don't have enough knowledge to do that, but for a future project.

Thank you for your time!