I try to get the availability / price for every day at https://www.homeaway.pt/arrendamento-ferias/p418841 by clicking on the calendar, checking which days are busy or not clicking the next button so that it can move on to the next month.
I also want to click on the arrival date and then select the discharge date so that I can see the price for it.
I run into problems because I try commands that work in chrome, but then they don't seem to work in selenium.
For instance:
I do:
self.driver.get(url) wait = WebDriverWait(self.driver, 10) try: elem = wait.until( EC.visibility_of_element_located( ( By.CSS_SELECTOR, "#startDateInput" ) ) ) except TimeoutException: pass else: elem.send_keys(Keys.NULL)
This seems to open the calendar, and I can also indicate the days available:
for x in self.driver.find_elements_by_css_selector(".stab-calendar-day.stab-calendar-day-active.stab-calendar-day-selectable.pull-left"): print(x.get_attribute('data-formatted-date'))
But then, when I want to move to the next active month, it continues to show the same starting month, and this is because it does not work:
self.driver.find_element_by_css_selector('.stab-calendar-controls-next').click()
selenium.common.exceptions.NoSuchElementException: Message: cannot find element: {"method": "css selector", "selector": ". stab-calendar-controls-next"}
Any ideas on how I can get the affordability / price of a house for each set of selected days?
source share