-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request to add Wycombe / Chiltern Council #154
Comments
Ah yes, Chiltern. Otherwise known as the bane of my Python skills 😆 |
I've been going nowhere for a while trying to get this to work in HA, I was so happy when I found this project! To only realise others have been here before :/ |
It's been a while since I looked at it kind, so I'll give it another go 😁 |
@dp247 I might have a working implementation of this, utilising Selenium. It needs a little bit of work to bring it into line with the rest of the package, but I'm happy to do this if you don't already have something in the pipeline? |
@preator67 I've delegated it to @robbrad to look at. I'm not entirely against the idea, but I'm not sure how selenium's dependencies would change/interfere with the project |
I'll take a look at this tomorrow night 👍 |
Im not having the best fun with this one - the following should work as far as I can see but no result is returned - they must have some rate limiting setup
@preator67 - are you using https://selenium-python.readthedocs.io/ - as long as
Im more than happy to have selenium do the heavy lifting - do you want to submit a PR? |
@robbrad yes, that’s the one. What I have working ticks the boxes on 1 and 4. Give me a little time to fully address/check 2 and 3, and I’ll submit a PR |
I can help on 2/3 if you need it or get stuck 👍 Check contributing.md if you need guidance or check the Cheshire east council/previous PRs I'm actually quite excited to see some selenium in action |
Sorry to be slow on this. I'm struggling with integration/unit tests, but this may be because I've had to go about things abnormally. @robbrad I would therefore some input on if this approach is workable with the existing framework. Firstly, I've had to execute the file as: The The following then produces a JSON in the correct format:
I believe it is then failing the integration test because it is trying to execute without the
but this did not seem to have any effect? |
Looks really good @preator67 - to add the ability to take from the input json you need to add a small change to https://github.com/robbrad/UKBinCollectionData/blob/master/uk_bin_collection/tests/features/steps/validate_council.py#L25 This will then use the switch as specified - If you want to share a repo where you have this I could try it out ? |
Thanks for the pointer @robbrad - makes sense when you know where to look. I've submitted a PR. If it's all OK, I can write some info for the Wiki - as this requires a bit more info from the user than other councils. |
Fantastic work @preator67 |
@preator67 - the integration tests came back saying lxml was missing - does this need adding to the Poetry.toml? |
@robbrad Yes, it does - apologies, not sure how that got missed off. |
This one looks to be all implemented, closing. |
Name of Council
Chiltern Council
Example Postcode
HP10 9TX
Additional Information
First page: https://chiltern.gov.uk/collection-dates requires to enter postcode, press Submit andthen choose house number, then submit
The next page gives the results
First page calls this URL after entering postcode:
https://chiltern.gov.uk/apiserver/postcode?callback=jQuery2240753028558035197_1673034357951&jsonrpc={"id":+25266114,"method":+"postcodeSearch","params":+{"provider":+"",++"postcode":+"hp10+9tx"}}&_=1673034357952
It seems to set a session ID after choosing a postcode/house number, this is then set as a cookie and passed to the next page whcih displays the results for the next bin collection days (there is no calendar that I could find)
PS This plug in is awesome! Wish the councils would standardise the data and have a public API!
Edit: #38 looks to be the same website
The text was updated successfully, but these errors were encountered: