Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import urllib.request
  2. import time
  3. def main():
  4. address="https://target.com"
  5. response=urllib.request.urlopen(address)
  6. bytes=response.read()
  7. text=bytes.decode()
  8. listHyper=[]
  9. findHyper(text,listHyper)
  10. response.close()
  11. def findHyper(text,listHyper):
  12. i=text.find("href")
  13. while i!=-1:
  14. start=text.find("\"",i)
  15. end=text.find("\"",start+1)
  16. #print(text[start+1 : end])
  17. i=text.find("href",end+1)
  18. if text[start+1:end][0:4]=="http" and text[-3:]!="png" and text[-4:]!="json" and text[-2:]!="js":
  19. listHyper.append(text[start+1:end])
  20. for z in range (0,len(listHyper)):
  21. print(listHyper[z])
  22. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement