flightplan-tool / flightplan

Search for award inventory using Node.js and Headless Chrome!
Apache License 2.0
140 stars 41 forks source link

NH award search failing #48

Open shmeta opened 5 years ago

shmeta commented 5 years ago

I ran flightplan search -w NH -f YEG -t CPT -c economy -s 2019-06-02 -e 2020-06-02 -q 1 It is successful if 0 rewards are found. However if there is an award, it comes back with "Error: Unrecognized Airport: Vancouver" or whatever city a reward is found with layovers. I've spoke to a few people who are having the same issue - thought it would be a good idea to raise this here. FlightPlan NH Error

zubairv85 commented 5 years ago

I have run into this issue before. There is a bug in the NH parser when parsing the airport name. Basically, we look for the airport name/code in one of the HTML elements on the page and then look up the airport information using that name/code.

For certain airports, it works because there is no additional information within that HTML element. It contains just the name (e.g. 'Tokyo(Narita)'. For certain airports, it doesnt work because there is additional data within that HTML element (e.g. 'Vancouver Terminal: M').

I have a fix that I am about to issue a pull request for.

jd20 commented 5 years ago

PR has been merged, and I've pushed v0.3.51. @shmeta Do you want to try again, to see if the issue is fixed for you?