I'm using Selenium WebDriver in Python 3 to scrape this webpage/relevant HTML (Pastebin) and am trying to get a list of prices in the "Departing flights" div. This div does not have an ID nor does it have a CSS class name, so I tried identifying it via XPath. On the Pastebin, to find the div that I'm talking about, Ctrl + F <div class="">.
Here is my code:
outbound_fares = browser.find_elements_by_xpath("//*[@id='air-booking-product-0']/div[4]")
outbound_prices = outbound_fares.find_elements_by_class_name("currency_dollars")
The first line should identify the div and the second line should get a list of all the prices within that div. However, I find that outbound_prices is empty. My guess is that the first line is wrong, but I'm not sure how to properly identify the div. Thanks.