mampfes / hacs_waste_collection_schedule

Home Assistant integration framework for (garbage collection) schedules
MIT License
1.08k stars 658 forks source link

Request for United Kingdom - Walsall Council support #432

Closed xavierxxiii closed 1 year ago

xavierxxiii commented 1 year ago

https://cag.walsall.gov.uk/BinCollections/

Sample postcode: WS10 8HS

dt215git commented 1 year ago

Looks simple enough, have you had a go at it yourself?

xavierxxiii commented 1 year ago

really new to this so no idea where to start but if you think it's simple, I will see what I can do. Any pointers will be appreciated

dt215git commented 1 year ago

There are plenty of online/youtube on web scraping, so they'll give some general ideas, but most people will open up the web developer tools window in their browser and watch the requests/responses being sent to get a feel for what's going on as you interact with the page. No harm in having a play with that and seeing what you notice - sometimes you'll see an underlying api being used, sometimes you'll just see it loading html. Where you go from there depends on what you see.

In terms of the Walsall site here are a few things that jump out:

There's no harm in looking at the .md and .py files in the repo to see how other UK councils have been dealt with, you'll see how others have approached things and there's a decent amount of copy, paste & adapt going on.

It may be simpler to have a play in a stand alone script in the first instance. If you can get that extracting the collection dates then it can be tweaked to work within this add on.

xavierxxiii commented 1 year ago

Super helpful. Thank you!