0

I would appreciate some help understanding the function of visibility_of_element_located() and to extract data under the class "price option-text" from the page https://www.ae.cheapflights.com/flight-search/KUL-LON/2020-05-30?sort=price_a

In follow up to How to grab the price information from flight reservation site https://reservations.airarabia.com

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
FL44ME
  • 49
  • 4
  • What does the Selenium/python documentation state about `visibility_of_element_located()`? Did you read it? It seems like you are asking two questions here... you need to edit your question and pick one because only one question should be asked at a time. – JeffC Sep 01 '19 at 23:01

1 Answers1

0

Apparently get_attribute(name) method or text attribute would have sufficed to our need to extract the price information from the flight reservation site. However if you look into the HTML DOM of the website the desired elements are JavaScript enabled elements which may/not be clickable/interactable as soon as (document.readyState").equals("complete") is achieved.

You can find a relevant discussion in Do we have any generic function to check if page has completely loaded in Selenium

As per best practices, in those cases you have to induce WebDriverWait in conjunction with expected_conditions either for:

You can find a relevant discussion in How to sleep webdriver in python for milliseconds

Hence in your usecase we need to use visibility_of_element_located

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352