kcajc / usvisa-ca Goto Github PK
View Code? Open in Web Editor NEWA script for making US visa appointments in Canada
A script for making US visa appointments in Canada
Hi,
Thanks for uploading and sharing the code, I am also one uwaterloo student try to get an interview spot within1-2months. I runned your code and the website logged in unsucessfully for 5-6 times, and then the usvisa website refused to connect, do you have any clue? If you want to discuss via email, my university email start with j872wang, and I would like to pay for your help! Thank you!
This works in (Türkiye) Turkey. But when he found a new appointment slot, he did not choose the time between 07:00 and 08:30. That's why I couldn't get a new appointment date.
Sorry for the broken english, I used google translate.
Hi kcaja,
Thanks for your job.
I also did a script with selenium three years ago and it worked well. However, in 2024, it seems there are fewer visa slots at the U.S. Embassy in Canada. Then my visa got expired, and my family needs the visa as soon as possible, so I had to find a better way to get a close slot.
Obviously, selenium is slower than requests, so I tried to use requests to invoke their APIs directly. However, I failed for the login process and the reschedule process. Even if I send the correct token and Cookie, it returns "login needed". More interesting is that, the APIs between these two steps can be invoked well, it means after using selenium to do the login and then using the obtained cookie to search the available slots by requests is possible. I think the website may have used some other tricks to prevent the logins and reschedule function by invoking the APIs directly. Could you try to do it on your side? Or maybe we can discuss with it.
Then, another big problem is that the website has risk control system. It means that if you refresh too often, you will be banned from the website for around 5 hours. This leads to the fact that even if you can go through the whole process with requests, it doesn't make much sense. As it stands now, you can't get slots unless you refresh every second, because the slots are really rare these days, but if you do it every second, you will be banned immediately. And I know there are some people and even companies that profit from getting a slot in Canada, and they have a very high success rate, so I don't know how they solve this problem. Do you have any idea about this?
It seems like, on the landing page, it can't click the Continue
button.
Should we change to using XPATH?
Sign in page
Landing page
TERM environment variable not set.
Attempt: 1
ERROR!!! Please check user email/password or network
#################################
rescheduling to an ideal time directly can be hard, rn I'm doing manual update of the MAX_WAIT_MONTH. I'm thinking of doing a continuous rescheduling that finds the best available month, reschedule, then update the best available month to current best-1, and continue the while loop. not sure how to do so, but it should be a good feature to have
Currently, the program runs pretty smoothly, but can there be an enhancement to check other provinces and not just the default province for available dates? It might be a stretch but could come in handy.
The logs are below.
Session retry: 4
20:56:06 FOUND SLOT ON 2025-05-16!!!
Rescheduling failed: Message: element not interactable
(Session info: chrome=122.0.6261.58)
Stacktrace:
GetHandleVerifier [0x00848C93+51395]
(No symbol) [0x007B5EF1]
(No symbol) [0x0066E004]
(No symbol) [0x006A71C7]
(No symbol) [0x0069E54E]
(No symbol) [0x006C3E8C]
(No symbol) [0x0069DF7E]
(No symbol) [0x006C4124]
(No symbol) [0x006DA570]
(No symbol) [0x006C3C26]
(No symbol) [0x0069C629]
(No symbol) [0x0069D40D]
GetHandleVerifier [0x00BC6453+3711107]
GetHandleVerifier [0x00C0583A+3970154]
GetHandleVerifier [0x00C00B28+3950424]
GetHandleVerifier [0x008F9C99+776393]
(No symbol) [0x007C16C4]
(No symbol) [0x007BC5A8]
(No symbol) [0x007BC759]
(No symbol) [0x007ADD80]
BaseThreadInitThunk [0x76A2FCC9+25]
RtlGetAppContainerNamedObjectPath [0x776F7C5E+286]
RtlGetAppContainerNamedObjectPath [0x776F7C2E+238]
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.