flightplan-tool / flightplan

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

CX - Doesn't log in, doesn't save results #31

Closed sostopher closed 5 years ago

sostopher commented 5 years ago

Hi there,

Trying to run any search on CX fails at login and returns this error:

flightplan search 0.3.45
Searching 9 days of award inventory: 12/25/2019 - 01/02/2020
[CX] DEPARTURE [MEL -> LHR] - 2019-12-25 (1 Passenger)
[CX] info Logging in...
[CX] error Unexpected error occurred while searching!
Error: Evaluation failed: TypeError: Cannot read property 'value' of null
    at sel (__puppeteer_evaluation_script__:1:36)
    at ExecutionContext.evaluateHandle (/Users/me/.config/yarn/global/node_modules/puppeteer/lib/ExecutionContext.js:124:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Looking in the Chrome window, no credentials are attempted to be entered and the page fails but still ticks to new dates in the command window. Same happens on different searches on CX for me. I have added account details in accounts.txt.

OS: MacOS Mojave 10.14.2

I've also noted that when it completes (after manual login), no results are added to the database, even though the CLI shows that it found awards and flights:

Example:

[CX] DEPARTURE [LAX -> MEL] - 2019-12-28 (1 Passenger)
[CX] success Found: 70 awards, 14 flights
[CX] DEPARTURE [MEL -> LAX] - 2019-12-29 (1 Passenger)
[CX] success Found: 72 awards, 9 flights
[CX] DEPARTURE [LAX -> MEL] - 2019-12-29 (1 Passenger)
[CX] success Found: 71 awards, 15 flights
[CX] DEPARTURE [MEL -> LAX] - 2019-12-30 (1 Passenger)
[CX] success Found: 72 awards, 9 flights
[CX] DEPARTURE [LAX -> MEL] - 2019-12-30 (1 Passenger)
[CX] success Found: 66 awards, 10 flights
[CX] DEPARTURE [MEL -> LAX] - 2019-12-31 (1 Passenger)
[CX] success Found: 72 awards, 9 flights
[CX] DEPARTURE [LAX -> MEL] - 2019-12-31 (1 Passenger)
[CX] success Found: 57 awards, 9 flights
success Search complete!

I then run parse:

$ flightplan parse
flightplan parse 0.3.45
info Opening database...
info Parsing search requests...
success Search requests processed: 0
success Total awards found: 0

When running the web UI, the same thing happens and no data is shown. There's JSON and the sqlite db created, but nothing seems to be saving even though it found these results.

Any help is appreciated! :)

sostopher commented 5 years ago

Running flightplan stats shows the data is somewhere:

$ flightplan stats
flightplan stats 0.3.45
Opening database...
Analyzing requests table...
Analyzing awards table...

MEL-DXB:
  CX [first, 1x]: 11 requests, 300 awards
DXB-MEL:
  CX [first, 1x]: 10 requests, 240 awards
MEL-LAX:
  CX [first, 1x]: 6 requests, 456 awards
LAX-MEL:
  CX [first, 1x]: 6 requests, 424 awards
MEL-LHR:
  CX [first, 1x]: 8 requests, 617 awards
LHR-MEL:
  CX [first, 1x]: 8 requests, 541 awards

Totals:
  6 routes (3 unique)
  49 requests
  2578 awards
ferni7 commented 5 years ago

try flightplan parse --force

sostopher commented 5 years ago

That's done it! Thanks!

$ flightplan parse --force
flightplan parse 0.3.45
info Opening database...
info Parsing search requests...
success Search requests processed: 49
success Total awards found: 2382
sostopher commented 5 years ago

Although, I'll keep this issue open for the login issue.

Timothy0927 commented 5 years ago

I do have CX login issue as well after updating to the latest version.

2019-01-22 13 52 19

I haven't tried manual login yet, maybe I'll try it later.

jd20 commented 5 years ago

Login issue is fixed on 0.3.46.