My program tries to search links on web pages And when the page is valid the application writes [+] Found [+] and if the link is not valid write [+] Error [+] but each link does not have the same length . Here is an example of how the application looks when I run it foobar.com/test [+] Found [+]
foobar.com/test21 [+] Error [+]
foobar.com/test333 [+] Error [+]
As you can see the position of the message moves because the link is longer. I want the Found
or Error
message to come out in the same vertical row like this:
foobar.com/test [+] Found [+]
foobar.com/test21 [+] Error [+]
foobar.com/test333 [+] Error [+]
But not so close to the link because there may be an error that would be if a link is longer than the length between the link and the message Error
or Found
Here I have my code
for i in array:
try:
adminpanel = urllib2.urlopen(website+i)
checkurl = adminpanel.code
if checkurl == 200:
print Fore.GREEN+ website+i," "" " +"[+] Found [+] "
continue
except urllib2.URLError, checkurl:
if checkurl == 404:
print website+i," "" Not Found :/"
else:
print Fore.RED+ website+i," "" " +"[+] Error [+] " + Style.RESET_ALL