Skip to content

Commit

Permalink
fix: Northumberland Council
Browse files Browse the repository at this point in the history
fix: #1082
  • Loading branch information
m26dvd committed Jan 5, 2025
1 parent 51e2323 commit dea6886
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion uk_bin_collection/tests/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@
"house_number": "22",
"postcode": "NE46 1UQ",
"skip_get_url": true,
"url": "https://www.northumberland.gov.uk/Waste/Bins/Bin-Calendars.aspx",
"url": "https://www.northumberland.gov.uk/Waste/Household-waste/Household-bin-collections/Bin-Calendars.aspx",
"web_driver": "http://selenium:4444",
"wiki_name": "Northumberland Council",
"wiki_note": "Pass the house number and postcode in their respective parameters. This parser requires a Selenium webdriver."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def extract_styles(self, style_str: str) -> dict:
def parse_data(self, page: str, **kwargs) -> dict:
driver = None
try:
page = "https://www.northumberland.gov.uk/Waste/Bins/Bin-Calendars.aspx"
page = "https://www.northumberland.gov.uk/Waste/Household-waste/Household-bin-collections/Bin-Calendars.aspx"

data = {"bins": []}

Expand Down Expand Up @@ -74,14 +74,16 @@ def parse_data(self, page: str, **kwargs) -> dict:
"span",
id="p_lt_ctl04_pageplaceholder_p_lt_ctl02_WasteCollectionCalendars_spanRouteSummary",
)
.string.replace("Routes found: ", "")
.text.replace("Routes found: ", "")
.split(","),
)
)

# Get the background colour for each of them...
bins_by_colours = dict()
for bin in bins_collected:
if "(but no dates found)" in bin:
continue
style_str = soup.find("span", string=bin)["style"]
bin_colour = self.extract_styles(style_str)["background-color"].upper()
bins_by_colours[bin_colour] = bin
Expand Down
2 changes: 1 addition & 1 deletion wiki/Councils.md
Original file line number Diff line number Diff line change
Expand Up @@ -2368,7 +2368,7 @@ Note: You will need to use [FindMyAddress](https://www.findmyaddress.co.uk/searc

### Northumberland Council
```commandline
python collect_data.py NorthumberlandCouncil https://www.northumberland.gov.uk/Waste/Bins/Bin-Calendars.aspx -s -p "XXXX XXX" -n XX -w http://HOST:PORT/
python collect_data.py NorthumberlandCouncil https://www.northumberland.gov.uk/Waste/Household-waste/Household-bin-collections/Bin-Calendars.aspx -s -p "XXXX XXX" -n XX -w http://HOST:PORT/
```
Additional parameters:
- `-s` - skip get URL
Expand Down

0 comments on commit dea6886

Please sign in to comment.