-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
num_flights #7
Comments
+1 |
Any update on this? All flights are now queried correctly or still returns only the first 21 flights? |
If anyone is still interested in this, the class name of the div containing the button is more_flights_div = driver.find_element(
by=By.CLASS_NAME,
value="ZVk93d",
)
more_flights_button = more_flights_div.find_element(
by=By.CSS_SELECTOR, value="button"
)
more_flights_button.click() From there, since you know how many elements to wait for you just need to wait for them. Then each flight's info is in another list item with class name driver.find_elements(by=By.CLASS_NAME, value="pIav2d") It might take some changes to the parsing code but you probably can just drop this into Hope this helps. |
Hi Kaya!
Version 1.1 looks great!
I want to suggest an option to parse a fixed number of flight options at once. Currently, the received number of flights is limited.
Here is an example, let's say we will take SFO - IST, from Aug 1 to Aug 17. If you search for it you can actually see that there are more than 120 flights in the case of a one-way ticket and more than 70 flights in the case of a round-trip, while the Scrape returns only 21 flights in total.
I am guessing that the current version of the scraper returns only the flights from the front page. In that case, I would suggest making it possible to push this "X more flights" button with Selenium in order to get the needed number of flights in the same window.
On the other hand, it might be not necessary to make it a number of flights against making it a useful set of filters like date/time of arrival, time of the flight, etc.
Hope that is interesting.
Have an amazing week!
The text was updated successfully, but these errors were encountered: