I'm trying to make a program that checks username availability on Ubisoft.com. I'm trying to do this by entering a profile URL letting the code check whether the site gives a 200- or a 404 status code, with 404 being a Taken username and 200 an Available username.
If an username is taken on the Ubisoft.com website it will give a 200-Status code, while if the username does not yet exist it will give a 404 page.
So first of all here's the code
import pyfiglet
import datetime
import urllib.request
ascii_banner = pyfiglet.figlet_format("Made By Gxzs!!")
print(ascii_banner)
print("Press ENTER to begin checking")
input("")
(urllib.request.urlopen("https://ubisoftconnect.com/en-US/profile/test1241924").getcode())
if (urllib.request.urlopen("https://ubisoftconnect.com/en-US/profile/test1241924").getcode()) == 200:
print ("TAKEN")
if (urllib.request.urlopen("https://ubisoftconnect.com/en-US/profile/test1241924").getcode()) == 404:
print ("AVAILABLE!")
I used an available username to test the code:
"https://ubisoftconnect.com/en-US/profile/test1241924"
The output of the code is TAKEN, which means the page gave a 200-Status code according to the code. But if you look up the link of the tested username it gives a 404-Status code as the username is unavailable.
What I have tried:
I have tried checking other links with available usernames, but all gave a 200 status code and had output TAKEN