I'm new to python and working on a python project that checks username availability on Ubisoft.com. I'm trying to do this by entering a wordlist of possible usernames and letting the code check wether the site gives a 200- or a 404 status code, with 404 being a Unavailable username and 200 an Available username. When I run the code I get this traceback error message:
File "C:\Users\Gibbo\OneDrive\Bureaublad\uPlay\usernamess.py", line 7, in <module>
response = urllib.response.status_code("https://ubisoftconnect.com/en-US/profile/")
AttributeError: module 'urllib.response' has no attribute 'status_code'
And here's the code I've made
import datetime
import urllib.request
import urllib
import requests
url = "https://ubisoftconnect.com/en-US/profile/"
response = urllib.response.status_code("https://ubisoftconnect.com/en-US/profile/")
print(r.status_code)
url = 'https://ubisoftconnect.com/en-US/profile/'
available = "available.txt"
users = "usernames.txt"
now = datetime.datetime.now ()
if response.status_code == 200:
print('Available')
elif response.status_code == 404:
print('Unavailable')
def initialize():
ascii_banner = pyfiglet.figlet_format("Made By Gxzs!!")
print(ascii_banner)
print(f"{count()} usernames detected")
print("Press ENTER to begin checking")
input("")
check()
I'm fairly new to Python coding so I was not able to try out things myself