Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Unable to find Manage Appointment button #32

Open
weilun106 opened this issue Feb 7, 2017 · 10 comments
Open

Unable to find Manage Appointment button #32

weilun106 opened this issue Feb 7, 2017 · 10 comments

Comments

@weilun106
Copy link

Hi all. I'm trying to use the script for my friend, which was working couple months ago for me. I got the following error,

Please wait...
On GOES login page...
Error on page: TypeError: null is not an object (evaluating 'document.querySelector('form[action=j_security_check]').submit')

  phantomjs://code/ge-cancellation-checker.phantom.js:55 in onError
Error on page: ReferenceError: Can't find variable: submitHome

  phantomjs://code/ge-cancellation-checker.phantom.js:55 in onError
Fatal error: Unable to find Manage Appointment button

I can get around the Can't find variable: submitHome by manually calling window.location to the full URL, props to @iokevins shared in #20. However, .bluebutton[name=manageAptm] does not seem to respond. Any ideas?

Also they have updated the location selection page from drop down menu. Not sure if it's going to affect the script. Cannot get it tested at the moment.

@jowilki
Copy link

jowilki commented Feb 8, 2017

Maybe SSL handshake issue, try this to debug:

page.onResourceError = function(resourceError) {
  console.log('Unable to load resource (#' + resourceError.id + 'URL:' + resourceError.url + ')');
  console.log('Error code: ' + resourceError.errorCode + '. Description: ' + resourceError.errorString);
};

and you can see if this works to confirm:
phantomjs --ignore-ssl-errors=yes --ssl-protocol=tlsv1 ge-cancellation-checker.phantom.js

@weilun106
Copy link
Author

@jowilki Thanks for the response. I tried but it seems not the case. There's no error message after adding function(resourceError). I'm still getting Fatal error: Unable to find Manage Appointment button.

Just curious if I'm the only one who cannot get the script running on OSX? Found another guy getting the same issue on El Cap as well.

@jowilki
Copy link

jowilki commented Feb 8, 2017

This works for me as-is on OSX El Capitan (didnt need to change ssl params). What does the page.onResourceError return for you?

I don't think any of the html selectors have changed so it seems like there's some error with the request in your case. They did start using radial buttons instead of the dropdown, but that hasn't affected the script since the dom element is the same.

@weilun106
Copy link
Author

I added function(resourceError) under function(msg, trace) , like this,

    if (!VERBOSE) { return; }
    console.error('Error on page: ' + msg);
}

page.onResourceError = function(resourceError) {
  console.log('Unable to load resource (#' + resourceError.id + 'URL:' + resourceError.url + ')');
  console.log('Error code: ' + resourceError.errorCode + '. Description: ' + resourceError.errorString);
};

Am I using it wrong? This is all I was getting and nothing really helps.

Please wait...
On GOES login page...
Error on page: TypeError: null is not an object (evaluating 'document.querySelector('form[action=j_security_check]').submit')

  phantomjs://code/ge-cancellation-checker.phantom.js:55 in onError
Bypassing human check...
Fatal error: Unable to find Manage Appointment button

I'm using OSX Sierra 10.12.1 though. Can confirm that it was fine when I was using El Cap.

@jondubin
Copy link

Has anyone found a fix for this yet? I can take a closer look at the bug, but was just wondering if someone else has already 😄

@nereocystis
Copy link

I see the same problem on Ubuntu, with slightly different output. Error discusses problem with loading local resource.

The name of the button looks fine, from perusing the console.

kevin@awabi:~/src/ge-cancellation-checker$ phantomjs ge-cancellation-checker.phantom.js -v
Please wait...
On GOES login page...
Logging in...
Bypassing human check...
Not allowed to load local resource: file://ge-cancellation-checker.phantom.js/goes/HomePagePreAction.do
Fatal error: Unable to find Manage Appointment button

@mbgearhead
Copy link

Hi nereocystis,

I had an identical problem using ubuntu 16.04 PhantomJS 2.1.1 (from apt). What us happening is that this script is not actually bypassing the "I'm human" check box correctly. I was able bypass this following the suggestion in this issue ([https://github.com//issues/20]). By replacing:
(line 109ish?) - submitHome();
with
window.location = "https://goes-app.cbp.dhs.gov/goes/HomePagePre Action.do";

Let me know if this helps. Cheers!

@jondubin
Copy link

jondubin commented Jul 3, 2017

I also had to change the interval between steps from 100 ms to 200 ms, which is on the last line of the JS file.

@wzaatar
Copy link

wzaatar commented Aug 15, 2017

I confirm having the same issue. I'm on Sierra 10.12.6 Tried @mbgearhead's suggestion on line 112 but that didn't fix the issue.

@mbgearhead
Copy link

Hi @wzaatar, did you try @jondubin suggestion to change the interval? Perhaps DHS is getting ahead of these automation apps again... As both I and my significant other already have global-entry, I unfortunately cannot debug this issue any longer. If someone else wants to take a crack at this, I'm happy to help out as needed

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

No branches or pull requests

6 participants