'How to scrape data that appears in HTML only when clicked on a option using python

I am trying to scrape data from this website: https://www.makemytrip.com/flight/search?itinerary=DEL-CHI-12/05/2022&tripType=O&paxType=A-1_C-0_I-0&intl=true&cabinClass=E&ccde=IN&lang=eng

In this website there is a option of view options. How to click on it using python (selenium or bs4), so I can extract its data. As the data loads only when you click on it.

Before clicking: enter image description here

After clicking: enter image description here

I had written this code:

rrr = driver.find_elements_by_class_name("appendLeft15 customArrow arrowDown")

for r in rrr:
   r.click()

But it is not working.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source