Giter Club home page Giter Club logo

Comments (18)

theoomoregbee avatar theoomoregbee commented on September 3, 2024 6

I will be taking a look soon at this

from us-visa-appointment-notifier.

ficusun avatar ficusun commented on September 3, 2024 6

@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);

from us-visa-appointment-notifier.

theoomoregbee avatar theoomoregbee commented on September 3, 2024 4

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.

from us-visa-appointment-notifier.

edithal-14 avatar edithal-14 commented on September 3, 2024 1

@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!

from us-visa-appointment-notifier.

wassimwazzi avatar wassimwazzi commented on September 3, 2024

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.

from us-visa-appointment-notifier.

afantastica688 avatar afantastica688 commented on September 3, 2024

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.)

from us-visa-appointment-notifier.

edithal-14 avatar edithal-14 commented on September 3, 2024

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

from us-visa-appointment-notifier.

olivercoconuts avatar olivercoconuts commented on September 3, 2024

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

from us-visa-appointment-notifier.

rupendersingh avatar rupendersingh commented on September 3, 2024

Has anyone found any solution ?

from us-visa-appointment-notifier.

fameka1 avatar fameka1 commented on September 3, 2024

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.

from us-visa-appointment-notifier.

dezluan avatar dezluan commented on September 3, 2024

Excited for the fix @theoomoregbee !

from us-visa-appointment-notifier.

SumitMistry avatar SumitMistry commented on September 3, 2024

I get is this error now:


> root@ubuntu-22:~/US-visa# npm start
> [email protected] 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`

from us-visa-appointment-notifier.

dezluan avatar dezluan commented on September 3, 2024

@theoomoregbee Any chance a fix is imminent?

from us-visa-appointment-notifier.

theoomoregbee avatar theoomoregbee commented on September 3, 2024

@ficusun can you send a PR with this changes and I will approve and merge it in. Thanks.

from us-visa-appointment-notifier.

fameka1 avatar fameka1 commented on September 3, 2024

@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.

from us-visa-appointment-notifier.

ficusun avatar ficusun commented on September 3, 2024

@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

from us-visa-appointment-notifier.

theoomoregbee avatar theoomoregbee commented on September 3, 2024

already merged in. Thanks @ficusun for the suggestion.

from us-visa-appointment-notifier.

liuyang12 avatar liuyang12 commented on September 3, 2024

@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. uxDaniel/visa_rescheduler#31 (comment)

from us-visa-appointment-notifier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.