Replies: 6 comments 7 replies
-
I'd also be interested to know whether it's possible to use every council script using
Feels like it would be good to have a consistent input format and avoid special cases. Happy to do some legwork to adjust special case scripts, assuming it's possible. |
Beta Was this translation helpful? Give feedback.
-
Nice work @davida72 Running a managed service as you describe in the detail above has been on my mind for a long time(years in fact) There are other options for online selenium AWS Device Farm - desktop browser testing being one. I haven’t taken the project down this route for a few reasons.
With that said I’m not against exploring how we could make the process easier but I’d rather avoid making the project a black box. |
Beta Was this translation helpful? Give feedback.
-
Maybe I miss understood the money ask. Are you saying we cover it? Some more data for you - GitHub has 4 runners which run nightly with selenium. 312+ councils take 48 minutes to execute meaning roughly 1.6 councils a minute. If we api controlled or throttled the execution one server could support 16,380 people making 1 request a week |
Beta Was this translation helpful? Give feedback.
-
@davida72 one way to reduce the setup would be to remove docker it might be possible to ship the python package with a chrome standalone binary and then anyone who uses the package will have the dependencies to run the selenium integrations |
Beta Was this translation helpful? Give feedback.
-
If we move to playwright we can remove some of the selenium issues allowing people to run this locally with no need for a container should be zero config. I’ll need to test this approach |
Beta Was this translation helpful? Give feedback.
-
My ideal setup would be
Then I think it just works out of the box. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
When I first found this project I ran into a bunch of problems getting it working properly in Home Assistant.
Admittedly there were points when I should have read the documentation better, but I didn't. I had all sorts of UPRN headaches before I realised I didn't need it, then all sorts of headaches setting up Selenium and finding a URL that worked on my network. After that it took a while before I realised that the documentation was incorrect as it was asking me for a house number but it actually needed an exact address match as it appears in the council's dropdown list.
I wanted to see if I could create an easier setup.
The Idea
Could I completely automate the setup process so that no configuration was required?
The Challenges
The Process
Home Assistant provides Latitude and Longitude. Those can be passed to a Ordnance Survey API which returns a bunch of useful information including nearest property, its address and UPRN. The postcode can then be passed on to the Postcodes API which returns information about the neighbourhood including LAD24CD code. At this point, we have a lot of useful information about the property.
Using the LAD24CD I refer to the input.json and establish a matching council script if it's available. I can also use input.json to populate other information, ultimately creating an API URL.
From there I call an instance of uk_bin_collection_api_server running on a hosted docker container, which in turn uses a Selenium node on the same machine.
And IT WORKS! Here's a link to a proof of concept. Use the map to click on a building, which sends Latitude and Longitude.
Most councils scripts that use a UPRN work first time, including ones which need Selenium. For those that need a specific search item, like house number or exact address, the scripts fall down because it's not in the expected format, but I've allowed the input fields to be editable so you can manually adjust. TL;DR special cases don't work.
I'm using three external services:
Outstanding Issues
Just a set of ideas that might make setup easier.
Beta Was this translation helpful? Give feedback.
All reactions