@@ -38,15 +38,15 @@ def parse_data(self, page: str, **kwargs) -> dict:
38
38
# Wait for the postcode field to appear then populate it
39
39
inputElement_postcode = WebDriverWait (driver , 30 ).until (
40
40
EC .presence_of_element_located (
41
- (By .ID , "FINDYOURBINDAYS_ADDRESSLOOKUPPOSTCODE " )
41
+ (By .ID , "FINDYOURBINDAYS3WEEKLY_ADDRESSLOOKUPPOSTCODE " )
42
42
)
43
43
)
44
44
inputElement_postcode .send_keys (user_postcode )
45
45
46
46
# Click search button
47
47
findAddress = WebDriverWait (driver , 10 ).until (
48
48
EC .presence_of_element_located (
49
- (By .ID , "FINDYOURBINDAYS_ADDRESSLOOKUPSEARCH " )
49
+ (By .ID , "FINDYOURBINDAYS3WEEKLY_ADDRESSLOOKUPSEARCH " )
50
50
)
51
51
)
52
52
findAddress .click ()
@@ -56,7 +56,7 @@ def parse_data(self, page: str, **kwargs) -> dict:
56
56
(
57
57
By .XPATH ,
58
58
""
59
- "//*[@id='FINDYOURBINDAYS_ADDRESSLOOKUPADDRESS ']//option[contains(., '"
59
+ "//*[@id='FINDYOURBINDAYS3WEEKLY_ADDRESSLOOKUPADDRESS ']//option[contains(., '"
60
60
+ user_paon
61
61
+ "')]" ,
62
62
)
@@ -66,18 +66,21 @@ def parse_data(self, page: str, **kwargs) -> dict:
66
66
# Wait for the submit button to appear, then click it to get the collection dates
67
67
WebDriverWait (driver , 30 ).until (
68
68
EC .presence_of_element_located (
69
- (By .XPATH , '//*[@id="FINDYOURBINDAYS_RUBBISHDATE"]/div' )
69
+ (
70
+ By .XPATH ,
71
+ '//*[@id="FINDYOURBINDAYS3WEEKLY_RUBBISHRECYCLEFOODDATE"]/div' ,
72
+ )
70
73
)
71
74
)
72
75
time .sleep (2 )
73
76
74
77
soup = BeautifulSoup (driver .page_source , features = "html.parser" )
75
78
soup .prettify ()
76
79
77
- rubbish_div = soup .find (
78
- "div" , {"id" : "FINDYOURBINDAYS_RUBBISHDATE_OUTERDIV" }
80
+ rubbish_div = soup .find ("div" , {"class" : "rubbish_collection_difs_black" })
81
+ rubbish_date = rubbish_div .find (
82
+ "div" , {"class" : "rubbish_date_container_left_datetext" }
79
83
)
80
- rubbish_date = rubbish_div .find_all ("div" )[2 ]
81
84
if rubbish_date .text == "Today" :
82
85
rubbish_date = datetime .now ()
83
86
else :
@@ -86,10 +89,10 @@ def parse_data(self, page: str, **kwargs) -> dict:
86
89
"%A %d %B" ,
87
90
).replace (year = datetime .now ().year )
88
91
89
- recycling_div = soup .find (
90
- "div" , {"id" : "FINDYOURBINDAYS_RECYCLINGDATE_OUTERDIV" }
92
+ recycling_div = soup .find ("div" , {"class" : "rubbish_collection_difs_green" })
93
+ recycling_date = recycling_div .find (
94
+ "div" , {"class" : "rubbish_date_container_left_datetext" }
91
95
)
92
- recycling_date = recycling_div .find_all ("div" )[2 ]
93
96
if recycling_date .text == "Today" :
94
97
recycling_date = datetime .now ()
95
98
else :
@@ -98,10 +101,10 @@ def parse_data(self, page: str, **kwargs) -> dict:
98
101
"%A %d %B" ,
99
102
).replace (year = datetime .now ().year )
100
103
101
- food_div = soup .find (
102
- "div" , {"id" : "FINDYOURBINDAYS_FOODWASTEDATE_OUTERDIV" }
104
+ food_div = soup .find ("div" , {"class" : "rubbish_collection_difs_purple" })
105
+ food_date = food_div .find (
106
+ "div" , {"class" : "rubbish_date_container_left_datetext" }
103
107
)
104
- food_date = food_div .find_all ("div" )[2 ]
105
108
if food_date .text == "Today" :
106
109
food_date = datetime .now ()
107
110
else :
0 commit comments