Skip to content

Duplicate flight entries appear in search results #63

Description

@MatheusCyrillo

When parsing and appending flights to our results array, the same flight can be added multiple times:

Image

The only difference between one line and the other is the is_best property—does anyone know if it actually makes a difference?

My suggestion is to remove one of the lines:

flights = []
seen_keys = set()

 for i, fl in enumerate(parser.css('div[jsname="IWWDBc"], div[jsname="YdtKid"]')):
     flightkey = (name, departure_time, arrival_time, duration, stops_fmt, delay, price)

     if flightkey in seen_keys :
         continue

     flights_seen.add(flightkey)
     flights.append({ … })

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions