Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AC one-way search failing with "Missing form element: tripTypeOneWay" #51

Open
zedkyuu opened this issue Jun 9, 2019 · 2 comments
Open

Comments

@zedkyuu
Copy link

zedkyuu commented Jun 9, 2019

Log output:

[AC] error Unexpected error occurred while searching!
Error: Evaluation failed: Error: Missing form element: tripTypeOneWay
    at __puppeteer_evaluation_script__:6:19
    at ExecutionContext.evaluateHandle (/home/zq/node_modules/puppeteer/lib/ExecutionContext.js:121:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  -- ASYNC --
    at ExecutionContext.<anonymous> (/home/zq/node_modules/puppeteer/lib/helper.js:110:27)
    at ExecutionContext.evaluate (/home/zq/node_modules/puppeteer/lib/ExecutionContext.js:48:31)
    at ExecutionContext.<anonymous> (/home/zq/node_modules/puppeteer/lib/helper.js:111:23)
    at DOMWorld.evaluate (/home/zq/node_modules/puppeteer/lib/DOMWorld.js:112:20)
  -- ASYNC --
    at Frame.<anonymous> (/home/zq/node_modules/puppeteer/lib/helper.js:110:27)
    at Page.evaluate (/home/zq/node_modules/puppeteer/lib/Page.js:782:43)
    at Page.<anonymous> (/home/zq/node_modules/puppeteer/lib/helper.js:111:23)
    at module.exports.fillForm (/home/zq/node_modules/flightplan-tool/src/Searcher.js:160:17)
    at module.exports.search (/home/zq/node_modules/flightplan-tool/src/engines/ac/searcher.js:57:18)

I don't know JS, but I did look at the Aeroplan search page and found that the element seems to be named "tripTypeRoundTrip" and so I subbed that into the code. It seems to work now, but I don't really know yet if the data is worth anything.

@zubairv85
Copy link
Contributor

That seems right. The name of the round trip and one way radio button is 'tripTypeRoundTrip' so changing the value 'tripTypeOneWay' to 'tripTypeRoundTrip' as you did is the fix.

@zubairv85
Copy link
Contributor

I issued a pull request to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants