How can I do this:
Enter on this website (http://www.samair.ru/proxy/time-01.htm) and get the list of the ip address and turn it to a dictionary variable?
whit these code in particular, I only can get the first ip of the website
ip = urllib.urlopen('http://www.samair.ru/proxy/time-01.htm').read()
clientIp = re.search("(\d+\.\d+\.\d+\.\d+)", ip).group()
print clientIp
Use
findallinstead ofsearch:Note the “raw” string
r"…"that prevents interpretation of the backslashes as escape character.This gives you a list of strings containing the IP addresses. To turn it into a dictionary you need key–value pairs.