Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DATE_URL got 404 error page #75

Open
dumblejd opened this issue Jan 31, 2024 · 1 comment
Open

DATE_URL got 404 error page #75

dumblejd opened this issue Jan 31, 2024 · 1 comment

Comments

@dumblejd
Copy link

dumblejd commented Jan 31, 2024

tried in different time in case it's frequent access deny, still got 404 page when it run get_date().

I tried with different facility code (from 90-95) in case Vancouver don't have much slot.

the link is following, I replace the id with xxxx to protect my info:
https://ais.usvisa-info.com/en-ca/niv/schedule/xxxx/appointment/days/95.json?appointments[expedite]=false

image

@dumblejd
Copy link
Author

dumblejd commented Jan 31, 2024

nvm, got it work after using this

def get_date():
# driver.get(DATE_URL)
driver.get(APPOINTMENT_URL)
session = driver.get_cookie("_yatri_session")["value"]
NEW_GET = driver.execute_script(
"var req = new XMLHttpRequest();req.open('GET', '"
+ str(DATE_URL)
+ "', false);req.setRequestHeader('Accept', 'application/json, text/javascript, /; q=0.01');req.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); req.setRequestHeader('Cookie', '_yatri_session="
+ session
+ "'); req.send(null);return req.responseText;"
)
return json.loads(NEW_GET)

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

No branches or pull requests

1 participant