Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ def parse_data(self, page: str, **kwargs) -> dict:
# Wait for the postcode field to appear then populate it
try:
inputElement_postcode = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "q485476_q1"))
EC.presence_of_element_located((By.ID, "q499089_q1"))
)
inputElement_postcode.send_keys(user_postcode)
except Exception:
print("Page failed to load. Probably due to Cloudflare robot check!")

# Click search button
findAddress = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "form_email_485465_submit"))
EC.presence_of_element_located((By.ID, "form_email_499078_submit"))
)
driver.execute_script("arguments[0].click();", findAddress)

Expand All @@ -65,7 +65,7 @@ def parse_data(self, page: str, **kwargs) -> dict:
EC.element_to_be_clickable(
(
By.XPATH,
"//select[@name='q485480:q1']//option[contains(., '"
"//select[@name='q499093:q1']//option[contains(., '"
+ user_paon
+ "')]",
)
Expand All @@ -74,7 +74,7 @@ def parse_data(self, page: str, **kwargs) -> dict:

# Click search button
getBins = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "form_email_485465_submit"))
EC.presence_of_element_located((By.ID, "form_email_499078_submit"))
)
driver.execute_script("arguments[0].click();", getBins)

Expand Down Expand Up @@ -143,4 +143,4 @@ def parse_data(self, page: str, **kwargs) -> dict:
# This block ensures that the driver is closed regardless of an exception
if driver:
driver.quit()
return data
return data