jonkpirateboy / Pass-fur-alle

Since Polisens web queueing solution for getting a passport sucks, and it is more or less impossible to book a time, I wrote this small javascript. What it does is that it automates the searching for a bookable time. In the file you just change the constants to your information and away you go. :)
GNU General Public License v3.0
376 stars 96 forks source link

datepicker is not a function error #85

Closed poa8a closed 2 years ago

poa8a commented 2 years ago

I get the following error when running the script:

13:57:54.103 userscript.html?name=Pass%2520f%25C3%25BCr%2520alle.user.js&id=fe5ea994-421b-4ea7-bb1d-08bcaef0e088:143 Set constants
13:57:54.105 userscript.html?name=Pass%2520f%25C3%25BCr%2520alle.user.js&id=fe5ea994-421b-4ea7-bb1d-08bcaef0e088:143 Set button texts
13:57:54.108 userscript.html?name=Pass%2520f%25C3%25BCr%2520alle.user.js&id=fe5ea994-421b-4ea7-bb1d-08bcaef0e088:143 Time search view
13:57:54.109 userscript.html?name=Pass%2520f%25C3%25BCr%2520alle.user.js&id=fe5ea994-421b-4ea7-bb1d-08bcaef0e088:143 Start time search
13:57:54.109 userscript.html?name=Pass%2520f%25C3%25BCr%2520alle.user.js&id=fe5ea994-421b-4ea7-bb1d-08bcaef0e088:143 Start over time search
13:57:54.109 userscript.html?name=Pass%2520f%25C3%25BCr%2520alle.user.js&id=fe5ea994-421b-4ea7-bb1d-08bcaef0e088:143 Set timeout
13:57:54.109 userscript.html?name=Pass%2520f%25C3%25BCr%2520alle.user.js&id=fe5ea994-421b-4ea7-bb1d-08bcaef0e088:143 Long timeout
13:57:54.137 init.js:30 Uncaught TypeError: $(...).datepicker is not a function
    at init.js:30:22
    at dispatch (jquery?v=qWq_uEaMDsyjxUIrGMHmmh4Hs1ha7TuAcFmRMIvZ4O81:1:55286)
    at y.handle (jquery?v=qWq_uEaMDsyjxUIrGMHmmh4Hs1ha7TuAcFmRMIvZ4O81:1:52032)
(anonymous) @ init.js:30
dispatch @ jquery?v=qWq_uEaMDsyjxUIrGMHmmh4Hs1ha7TuAcFmRMIvZ4O81:1
y.handle @ jquery?v=qWq_uEaMDsyjxUIrGMHmmh4Hs1ha7TuAcFmRMIvZ4O81:1
load (async)
add @ jquery?v=qWq_uEaMDsyjxUIrGMHmmh4Hs1ha7TuAcFmRMIvZ4O81:1
(anonymous) @ jquery?v=qWq_uEaMDsyjxUIrGMHmmh4Hs1ha7TuAcFmRMIvZ4O81:1
each @ jquery?v=qWq_uEaMDsyjxUIrGMHmmh4Hs1ha7TuAcFmRMIvZ4O81:1
each @ jquery?v=qWq_uEaMDsyjxUIrGMHmmh4Hs1ha7TuAcFmRMIvZ4O81:1
on @ jquery?v=qWq_uEaMDsyjxUIrGMHmmh4Hs1ha7TuAcFmRMIvZ4O81:1
(anonymous) @ jquery?v=qWq_uEaMDsyjxUIrGMHmmh4Hs1ha7TuAcFmRMIvZ4O81:1
(anonymous) @ jquery?v=qWq_uEaMDsyjxUIrGMHmmh4Hs1ha7TuAcFmRMIvZ4O81:1

Any ideas?

jonkpirateboy commented 2 years ago

I don't get those errors. How are you using the script and what browser are you using?

poa8a commented 2 years ago

Chrome Version 100.0.4896.75 (Official Build) (x86_64) on Mac. I installed the extension through the Chrome webstore: chrome.google.com/webstore/detail/tampermonkey

I use the script just as described in in the readme. I set the date as below in the script:

// Constants log('Set constants'); var dateFrom = '2022-04-18'; var dateTo = '2022-06-01'; var autoConfirm = true;

Then on the booking page I select a specific "Passexpedition" and click on the button "Första lediga tid innan 2022-06-01".

Sometimes it also stops here: Screenshot 2022-04-11 at 15 42 30

If it stops here it does not continue to refresh so I will have to start all over again.

Falkens-swe commented 2 years ago

If you try to not enter an "passexpedition" and use "Västra Götalands län" and "alla län"

jesper-olsson commented 2 years ago

I'm getting the same error but it originates from the websites own source code at: /Booking/Scripts/Enalog/init.js I still managed to book a time even with the error. Not sure if there's an issue here.

jonkpirateboy commented 2 years ago

Not in scope for Pass für alle