This is the website of skyscanner. After selecting flight I want to click on every 'Select button'(for $687) and then go to next page. On next page I want to click down arrow for outbound flight. Then I again I want to click select button ($715) and the again outbound flight arrow. So it goes in loop for all possible searches on all the pages possible.
This is how Downward arrow on next page is
Here is the code I have written so far :
driver = webdriver.Chrome( )
driver.get('https://www.skyscanner.com/transport/flights/nyca/lax/170717/170718/airfares-from-new-york-to-los-angeles-international-in-july-2017.html?adults=1&children=0&adultsv2=1&childrenv2=&infants=0&cabinclass=economy&rtn=1&preferdirects=false&outboundaltsenabled=false&inboundaltsenabled=false&ref=home#results')
while True:
items=driver.find_element_by_class_name("fss-bpk-button expand-cba select-action")
for i, item in enumerate(items):
driver.find_element_by_class_name("fss-bpk-button expand-cba select-action").click()
for j, item2 in item
driver.find_element_by_class_name("leg-summary-container clearfix").click()
I also tried following but none worked:
links = [link.get_attribute('href') for link in driver.find_element_by_class_name("fss-bpk-button expand-cba select-action")]
for link in links:
driver.get(link)

