-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_file.py
More file actions
40 lines (30 loc) · 886 Bytes
/
Main_file.py
File metadata and controls
40 lines (30 loc) · 886 Bytes
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
import re
import socket
"""
mysocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
mysocket.connect (('tools.cisco.com', 443))
mysocket.send ("GET https://tools.cisco.com/security/center/ipshome.x\n")
while True:
data = mysocket.recv(512)
if (len(data) <1):
break
if re.search("var myData", data):
# result = re.findall(",\[\"([0-9]+/*[0-9]*\)]\",\"<a href=",line)
result = re.findall("\[\"([0-9]+)/[0-9]+\",", data)
print result
break
#print data
page = open("Cisco_ips_content_page.txt")
#["33459/0","<a
"""
"""
for lines in page:
line = lines.rstrip()
if re.search("var myData",line):
# result = re.findall(",\[\"([0-9]+/*[0-9]*\)]\",\"<a href=",line)
result = re.findall("\[\"([0-9]+)/[0-9]+\",",line)
break
print result
"""
#page.close()
#mysocket.close()