Closed afantastica688 closed 1 year ago
It looks like the page with the json of the dates has been removed on the US website, I am getting the same error. We need to find where this page has been moved to.
I will be taking a look soon at this
I will be taking a look soon at this
I manually set the version information like this:
Windows x64: node.js > 18.15.0 puppeteer > 19.8.5 (Because I am encountering an error while installing the 16.2.0 version embedded in the files "package.json".
I am getting a different error from the link below. When I do all the steps, I get the mailgun key error ("key" is required). https://github.com/mueedqadri/US-visa-appointment-notifier
I get an error even though I typed the mailgun domain and the password starting with "key-".
Again I manually set the versions like this: node.js > 18.15.0 puppeteer > 19.8.5
(I'm getting the same key error on version 16.2.0 of puppeteer.)
I am facing the same issue. Here is the stack trace
Unable to parse page JSON content <html><head></head><body></body></html>
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at checkForSchedules (/home/vigu/git/US-visa-appointment-notifier/index.js:53:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async process (/home/vigu/git/US-visa-appointment-notifier/index.js:85:24)
at async process (/home/vigu/git/US-visa-appointment-notifier/index.js:92:3)
at async /home/vigu/git/US-visa-appointment-notifier/index.js:100:5
I am having the same issue. It'll be great if this can be resolved soon. Appreciate the work!
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at checkForSchedules (C:\Users\olvr\US-visa-appointment-notifier\index.js:52:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async process (C:\Users\olvr\US-visa-appointment-notifier\index.js:84:24)
at async process (C:\Users\olvr\US-visa-appointment-notifier\index.js:91:3)
at async C:\Users\olvr\US-visa-appointment-notifier\index.js:99:5
Has anyone found any solution ?
It looks like the page with the json of the dates has been removed on the US website, I am getting the same error. We need to find where this page has been moved to. I looked at the site, the json link remains, but it does not work. So they did not put it in a new link. I needed this script urgently, but I could not find a solution.
I was able to replicate this with the help of a friend. I should be able to send a fix for this later this week.
Excited for the fix @theoomoregbee !
I get is this error now:
> root@ubuntu-22:~/US-visa# npm start
> us-visa-appointment-notifier@1.0.0 start
> node index.js
>
> =====>>> Step: starting process with 1000 tries left
> =====>>> Step: logging in
> =====>>> Step: checking for schedules
>
> Unable to parse page JSON content <html><head></head><body></body></html>
> SyntaxError: Unexpected end of JSON input
> at JSON.parse (<anonymous>)
> at checkForSchedules (/root/US-visa/index.js:52:30)
> at processTicksAndRejections (internal/process/task_queues.js:97:5)
> at async process (/root/US-visa/index.js:84:24)
> at async /root/US-visa/index.js:98:7
> =====>>> Step: starting process with 999 tries left
> =====>>> Step: logging in
> =====>>> Step: checking for schedules
>
> Unable to parse page JSON content <html><head></head><body></body></html>
> SyntaxError: Unexpected end of JSON input
> at JSON.parse (<anonymous>)
> at checkForSchedules (/root/US-visa/index.js:52:30)
> at processTicksAndRejections (internal/process/task_queues.js:97:5)
> at async process (/root/US-visa/index.js:84:24)
> at async process (/root/US-visa/index.js:91:3)
> at async /root/US-visa/index.js:98:7
>
> ^Z
> [1]+ Stopped npm start
> root@ubuntu-22:~/US-visa# bg
>
> [1]+ npm start &
> root@ubuntu-22:~/US-visa# =====>>> Step: starting process with 998 tries left
>
> =====>>> Step: logging in
> =====>>> Step: checking for schedules
>
> Unable to parse page JSON content <html><hea`
@theoomoregbee Any chance a fix is imminent?
@theoomoregbee you can fix it just add to checkForSchedules:
await page.setExtraHTTPHeaders({
'Accept': 'application/json, text/javascript, */*; q=0.01',
'X-Requested-With': 'XMLHttpRequest'
});
await page.goto(APPOINTMENTS_JSON_URL);
@theoomoregbee you can fix it just add to checkForSchedules:
await page.setExtraHTTPHeaders({ 'Accept': 'application/json, text/javascript, */*; q=0.01', 'X-Requested-With': 'XMLHttpRequest' }); await page.goto(APPOINTMENTS_JSON_URL);
Works like a charm!
@ficusun can you send a PR with this changes and I will approve and merge it in. Thanks.
@ficusun can you send a PR with this changes and I will approve and merge it in. Thanks.
Also, can you add two dates, eairliest date and latest date, to search for dates? For example, to send notifications between 2023-05-01 and 2023-07-01.
@ficusun can you send a PR with this changes and I will approve and merge it in. Thanks.
Yes, I can, within a couple of days
already merged in. Thanks @ficusun for the suggestion.
@theoomoregbee you can fix it just add to checkForSchedules:
await page.setExtraHTTPHeaders({ 'Accept': 'application/json, text/javascript, */*; q=0.01', 'X-Requested-With': 'XMLHttpRequest' }); await page.goto(APPOINTMENTS_JSON_URL);
works like magic. thanks @ficusun! and it works for the python version as well. https://github.com/uxDaniel/visa_rescheduler/issues/31#issue-1677087217
Hello.
I am encountering an error like this. What's the solution? I need help urgently. puppeteer version: 19.8.5
npm start
=====>>> Step: starting process with 250 tries left =====>>> Step: logging in =====>>> Step: checking for schedules
Unable to parse page JSON content
SyntaxError: Unexpected end of JSON input at JSON.parse (