-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspider.py
More file actions
50 lines (43 loc) · 1.32 KB
/
Copy pathspider.py
File metadata and controls
50 lines (43 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/python3
import requests
URL = "https://35.83.123.142/"
urlList = []
isFollowed = {}
def checkUrlList(URL):
if URL in urlList:
return True
else:
return False
def isFollowedCheck(URL):
for entry in isFollowed.keys():
if URL != entry:
return False
else:
if isFollowed[URL] == "yes":
return True
else:
return False
urlList.append(URL)
for URL in urlList:
if isFollowedCheck(URL) != True:
page = requests.get(URL)
isFollowed[URL] = "yes"
start = "http"
for line in page.text.split("\n"):
if "http" in line:
if "192.168.50.101" in line:
if "\">" in line:
end = "\">"
else:
end = "\" "
sliced = line[line.index(start):line.index(end)]
if "\"" in sliced:
end = "\""
parsedURL = sliced[sliced.index(start):sliced.index(end)]
else:
parsedURL = sliced
if checkUrlList(parsedURL) == False:
urlList.append(parsedURL)
isFollowed[parsedURL] = "no"
for URL in urlList:
print(URL)