Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib.request
- import time
- def main():
- address="https://target.com"
- response=urllib.request.urlopen(address)
- bytes=response.read()
- text=bytes.decode()
- listHyper=[]
- findHyper(text,listHyper)
- response.close()
- def findHyper(text,listHyper):
- i=text.find("href")
- while i!=-1:
- start=text.find("\"",i)
- end=text.find("\"",start+1)
- #print(text[start+1 : end])
- i=text.find("href",end+1)
- if text[start+1:end][0:4]=="http" and text[-3:]!="png" and text[-4:]!="json" and text[-2:]!="js":
- listHyper.append(text[start+1:end])
- for z in range (0,len(listHyper)):
- print(listHyper[z])
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement