flightplan-tool / flightplan

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

SQ Parsing #12

Closed ferni7 closed 5 years ago

ferni7 commented 5 years ago

Just ran a search

flightplan search -w SQ -f MEL -t SIN -c first -s 2018-11-01 -e 2018-11-30 -q 1 -h

Ran fine, but parsing says no awards found, yet looking at screenshots it captured I can see there are awards. ie 1st Nov - SQ238 and SQ228

andrew@fp:~$ flightplan parse flightplan parse 0.2.5 Opening database... Parsing search requests... Search requests processed: 0 Total awards found: 0 andrew@fp:~$

kirtan commented 5 years ago

+1, having same issue.

jd20 commented 5 years ago

Maybe it's reporting zero awards, because they were already parsed during search command? You can try the following command to force parsing:

❯ flightplan parse --force --verbose
Opening database...
Parsing search requests...
[SQ] DEPARTURE [SIN -> MEL] - 2018-11-01 (1 Passenger)
    [SIN -> MEL] - 2018-11-01 SQ237 (80000 Miles): FS+
    [SIN -> MEL] - 2018-11-01 SQ237 (150000 Miles): FA+
    [SIN -> MEL] - 2018-11-01 SQ217 (80000 Miles): FS+
    [SIN -> MEL] - 2018-11-01 SQ217 (150000 Miles): FA+
    [SIN -> MEL] - 2018-11-01 SQ227 (80000 Miles): FS@
    [SIN -> MEL] - 2018-11-01 SQ227 (150000 Miles): FA+
[SQ] DEPARTURE [SIN -> MEL] - 2018-11-02 (1 Passenger)
    [SIN -> MEL] - 2018-11-02 SQ237 (80000 Miles): FS@
    [SIN -> MEL] - 2018-11-02 SQ237 (150000 Miles): FA+
    [SIN -> MEL] - 2018-11-02 SQ217 (80000 Miles): FS@
    [SIN -> MEL] - 2018-11-02 SQ217 (150000 Miles): FA@
    [SIN -> MEL] - 2018-11-02 SQ227 (80000 Miles): FS@
    [SIN -> MEL] - 2018-11-02 SQ227 (150000 Miles): FA+
[SQ] DEPARTURE [SIN -> MEL] - 2018-11-03 (1 Passenger)
    [SIN -> MEL] - 2018-11-03 SQ237 (80000 Miles): FS@
    [SIN -> MEL] - 2018-11-03 SQ237 (150000 Miles): FA@
    [SIN -> MEL] - 2018-11-03 SQ217 (80000 Miles): FS@
    [SIN -> MEL] - 2018-11-03 SQ217 (150000 Miles): FA+
    [SIN -> MEL] - 2018-11-03 SQ227 (80000 Miles): FS@
    [SIN -> MEL] - 2018-11-03 SQ227 (150000 Miles): FA+
[SQ] DEPARTURE [MEL -> SIN] - 2018-11-01 (1 Passenger)
[SQ] ARRIVAL   [SIN -> MEL] - 2018-11-04
    [MEL -> SIN] - 2018-11-01 SQ218 (160000 Miles): FS@
    [MEL -> SIN] - 2018-11-01 SQ218 (300000 Miles): FA+
    [MEL -> SIN] - 2018-11-01 SQ238 (160000 Miles): FS+
    [MEL -> SIN] - 2018-11-01 SQ238 (300000 Miles): FA+
    [MEL -> SIN] - 2018-11-01 SQ228 (160000 Miles): FS+
    [MEL -> SIN] - 2018-11-01 SQ228 (300000 Miles): FA+
    [SIN -> MEL] - 2018-11-04 SQ1237 (160000 Miles): FS@
    [SIN -> MEL] - 2018-11-04 SQ1237 (300000 Miles): FA+
    [SIN -> MEL] - 2018-11-04 SQ1217 (160000 Miles): FS+
    [SIN -> MEL] - 2018-11-04 SQ1217 (300000 Miles): FA+
    [SIN -> MEL] - 2018-11-04 SQ1227 (160000 Miles): FS@
    [SIN -> MEL] - 2018-11-04 SQ1227 (300000 Miles): FA@
Search requests processed: 4
Total awards found: 50

If you're still getting no awards for that request, please attach the jpg and html.gz files for that particular date (should start with SQ-MEL-SIN-2018-11-01).

kirtan commented 5 years ago

@jd20 seems to have done the trick!

ferni7 commented 5 years ago

THanks, is that new in this version? not needing to run parse after search?

ferni7 commented 5 years ago

In the old version I think I could search for 1 pax then search for 2 pax and it would skip over anything that didn't have 1 pax to speed it up - great feature.... but ive just searched for 1 pax (as above) and it found awards, but now telling it to search for 2pax its not triggering a new search. Is this expected?

andrew@fp:~$ flightplan search -w SQ -f MEL -t SIN -c first -s 2018-11-01 -e 2018-11-30 -q 2 -h
flightplan search 0.2.5
Searching 30 days of award inventory: 2018-11-01 - 2018-11-30
Skipped 33 queries.
success Search complete!
jd20 commented 5 years ago

Running search / parse as a single command is a new option, that's on by default. You can mimic the old behavior by passing --no-parser.

The other thing you mention is a regression, I just pushed a fix for it (you can grab it as v0.2.6).

ferni7 commented 5 years ago

Perfect, makes sense to parse with search 0.2.6 working thanks!