Skip to content

Commit 6f1ccc6

Browse files
committed
fix: the cookie banner is not optional
1 parent f8a5cec commit 6f1ccc6

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

uk_bin_collection/uk_bin_collection/councils/NorthumberlandCouncil.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,14 @@ def parse_data(self, page: str, **kwargs) -> dict:
5151
wait = WebDriverWait(driver, 20)
5252

5353
# Wait for and click cookie button
54-
try:
55-
cookie_button = wait.until(
56-
EC.element_to_be_clickable((By.CLASS_NAME, "accept-all"))
57-
)
58-
cookie_button.click()
59-
except TimeoutException:
60-
print("Cookie banner not found, continuing...")
54+
cookie_button = wait.until(
55+
EC.element_to_be_clickable(By.CLASS_NAME, "accept-all")
56+
)
57+
cookie_button.click()
6158

6259
# Wait for and find postcode input
6360
inputElement_pc = wait.until(
64-
EC.presence_of_element_located(
65-
(By.ID, "postcode")
66-
)
61+
EC.presence_of_element_located((By.ID, "postcode")
6762
)
6863

6964
# Enter postcode and submit
@@ -72,9 +67,7 @@ def parse_data(self, page: str, **kwargs) -> dict:
7267

7368
# Wait for and find house number input
7469
selectElement_address = wait.until(
75-
EC.presence_of_element_located(
76-
(By.ID, "address")
77-
)
70+
EC.presence_of_element_located(By.ID, "address")
7871
)
7972

8073
dropdown = Select(selectElement_address)

0 commit comments

Comments
 (0)