polastre / united Goto Github PK
View Code? Open in Web Editor NEWA tool to find upgrade availability on United Airlines.
License: Other
A tool to find upgrade availability on United Airlines.
License: Other
Thank you so much for writing this! I've had a great time playing around with it.
I am a UA GS. I see more upgrade availability at UAs website than using the code. I think I know why.
Let's take an example. Running the code, I can see that there is upgrade availability on UA2160 on 5/5/2018. This is a flight that departs at 5:40 pm from San Francisco and arrives at 2:06 am in EWR [screenshot (https://photos.app.goo.gl/HlrIHsm1y2dUmodG2)].
When, I go to the United website, the flight has, indeed, a green arrow [screenshot (https://photos.app.goo.gl/ADD77THCSO9DvUCN2)].
However, this is not the only flight available for an upgrade. An earlier flight (UA 213) also has availability for immediate upgrade [screenshot (https://photos.app.goo.gl/dA6oyVx1h7kFKDXU2) ].
I think the reason is the following: GS members can be upgraded if there is PN, or P availability. UA213 shows availability in both of these, while UA2160 doesn't. However, UA2160 has availability in the R, RN fares, which are typically upgradeable for Premier 1k customers.
So, I am assuming that the code is somehow pulling R and RN availability.
This is more of a feature request than a bug: would it be possible to pull the PN and P availability with the code?
I'm getting this error msg on High Sierra.
TypeError: Cannot read property 'Trips' of undefined
at parseResults (/Users/ctk/Dropbox/bin_Bartolo/united-new-united-search/united.js:78:26)
at Request._callback (/Users/ctk/Dropbox/bin_Bartolo/united-new-united-search/united.js:107:18)
at Request.self.callback (/Users/ctk/Dropbox/bin_Bartolo/united-new-united-search/node_modules/request/request.js:198:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (/Users/ctk/Dropbox/bin_Bartolo/united-new-united-search/node_modules/request/request.js:1082:10)
at emitOne (events.js:82:20)
at Request.emit (events.js:169:7)
at IncomingMessage. (/Users/ctk/Dropbox/bin_Bartolo/united-new-united-search/node_modules/request/request.js:1009:12)
at emitNone (events.js:72:20)
First I wanna say, this tool is amazing, booked some nice trips because of it, so Thank You!
But it appears that the search doesn't work properly anymore. I search within minutes of each other through this tool and the United website for PZ (former R) fare. The tool didn't return a result, but on the website it showed availability. Does it have to do with that the switched from R to PZ fare?
I also can only search for 10 days at a time without getting an error message:
(node:1207) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit
(node:1207) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit
(node:1207) UnhandledPromiseRejectionWarning: Error: Navigation Timeout Exceeded: 30000ms exceeded
at Promise.then (/Users/name/Downloads/united-master/node_modules/puppeteer/lib/NavigatorWatcher.js:69:21)
(node:1207) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1207) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Or sometimes I get this message:
(node:1355) UnhandledPromiseRejectionWarning: Error: Navigation Timeout Exceeded: 30000ms exceeded
at Promise.then (/Users/name/Downloads/united-master/node_modules/puppeteer/lib/NavigatorWatcher.js:69:21)
(node:1355) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1355) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Any ideas what's going on?
Now that United offers a Premium Economy and Polaris Business Class the script is matching on either cabin. It would be nice to search specifically for business class or premium economy.
There used to be an editable file, united_request.json, by which one could change, e.g., the number of travelers in order to search for more than one seat. But this file no longer appears in the united-master directory following the download of the most recent version of this fabulous tool. Is this functionality still available?
After checking the first date in the range, subsequent dates error out with this message from casperjs.
An error occurred. Please try again.
CasperError: Errors encountered while filling form: no field matching names selector "ctl00$ContentInfo$ShowTrips$ShowTrip$ctl00$chkUpgrade" in form
The page looks like this -- which is empty for some reason. Maybe a cookie problem?
I am unable to use the current December 9th 458b0ca commit due to exceptions no matter what I search. I was able to run builds prior to the utilization of Puppeteer and have installed Node.js as per the instructions in the ReadMe. I have attached examples of the output I receive when I try to run it. I appreciate any help you can provide!
Figured out my issue. Never mind! My bad.
You get this error:
An error occurred. Please try again.
CasperError: Errors encountered while filling form: form not found
This is due to https://www.united.com/web/en-US/apps/booking/flight/searchOW.aspx?CS=N now redirecting to the new flight search form.
I've just installed the latest version of Node.js and the polastre/united on two PCs, work (Win10) and home (Win7).
on the work PC, that's behind corporate VPN, I've manually changed the NPM Proxy settings, and the connection seems successful. the home PC required no network changes.
running the same search string (or any other search) on the two computers, always returns different results:
node united.js MUC SFO 4/1/2017 4/10/2017
On the home PC I get one line per each date within my date range (green or red based on availability)
While on the work PC I always get just one result (in red) and it is not even the earliest date within my range, and then the loop seems to stop.
Screenshot of Home PC results:
Screenshot of Work PC results:
any ideas for troubleshooting?
Ive tried this recently but it never returns any results. Do we know if this tool still works or not? Could you give an example search that returns something?
/Users/pxia/work/united/united.js:78
var flights = data.data['Trips'][0]['Flights']
^
TypeError: Cannot read property 'Trips' of undefined
at parseResults (/Users/pxia/work/united/united.js:78:26)
at Request._callback (/Users/pxia/work/united/united.js:107:18)
at Request.self.callback (/Users/pxia/work/united/node_modules/request/request.js:198:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.<anonymous> (/Users/pxia/work/united/node_modules/request/request.js:1082:10)
at emitOne (events.js:120:20)
at Request.emit (events.js:210:7)
at IncomingMessage.<anonymous> (/Users/pxia/work/united/node_modules/request/request.js:1009:12)
at emitNone (events.js:110:20)
data
is a HTML error message from united website:
You don't have permission to access "http://www.united.com/ual/en/us/flight-search/book-a-flight/flightshopping/getflightresults/rev" on this server.
Hey,
I am trying to make a search and see how much will cost a ticket in points?
Thanks,
If this application could run in a container(my preferred option is still a docker container), it’ll be easier to port it without installing the node dependencies.
I’ll try to get it done when i have time.
Successfully installed and ran the script some time ago on my iMac and am now trying to install it on a MacBook Pro, but am receiving the following error (where united-master is the directory where the unzipped repository resides):
XXXMacBookProlocal:united-master David$ node united.js FRA SFO 7/28/2018 8/4/2018
module.js:549
throw err;
^
Error: Cannot find module 'puppeteer'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/Users/David/Downloads/united-master/united.js:1:81)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
Request URL:https://www.united.com/ual/en/us/flight-search/book-a-flight/flightshopping/getflightresults/rev
Request Method:POST
Status Code:403 Forbidden
Remote Address:184.28.169.28:443
Referrer Policy:no-referrer-when-downgrade
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.