2

I am trying to book flight for today and return from tomorrow from this link:https://www.makemytrip.com/flights/

python3 makemytrip.py 
//table/tbody/tr/td[@fare-date="1536863400000"]
//table/tbody/tr/td[@fare-date="1536949800000"]
Traceback (most recent call last):
  File "makemytrip.py", line 75, in <module>
    booktrip.flight_booking()
  File "makemytrip.py", line 66, in flight_booking
    date_picker_first.find_element_by_xpath(xpath).click()
  File "/home/juniour/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/home/juniour/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webelement.py", line 628, in _execute
    return self._parent.execute(command, params)
  File "/home/juniour/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 320, in execute
    self.error_handler.check_response(response)
  File "/home/juniour/.local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: Element <td class=" ui-datepicker-week-end "> could not be scrolled into view

For the departure input the xpath works fine but for return my xpath is nor working. i am using attribute fare-date in my xpath.

Here is my code: https://paste.pound-python.org/show/VKduz8mqKuxeBOESNzjt/

Hackaholic
  • 19,069
  • 5
  • 54
  • 72
  • xpath = '//table/tbody/tr/td[@fare-date="{}"]'.format(self.tomorrow) date_picker_first.find_element_by_xpath(xpath).click() The problem is in Xpath, I have the same problem, whenever I need to access somethign which pops out something ... in this case you click on a date and JavaScript ( i guess its Javascript ) throws out the date picker. I would recommand you to try to stop it for a seconds lets say and see if its going to fix the problem ( i would do it, but I dont have access to PC now :) GL – StyleZ Sep 14 '18 at 16:10
  • Thanks Guys i figured it out. – Hackaholic Sep 14 '18 at 19:16

0 Answers0