This is part of my python script:
with open("/tmp/IpList.txt", "r+") as f:
for ip in f:
page = 1
ip = ip.strip("\r\n")
print ip
while True:
url = 'http://www.bing.com/search?q=ip%3a' + ip + '&qs=n&pq=ip%3a' + ip + '&sc=0-0&sp=-1&sk=&first=' + str(page) + '&FORM=PERE'
print url
with open("/tmp/content.txt", "a") as out:
content = ContentFunc()
if "<cite>" in content and "</cite>" in content:
out.write(content)
with open("/tmp/result.txt", "a+") as result:
res = CiteParser()
result.write(res.encode('utf-8'))
page += 10
else:
break
I am going to handle my hosts from bing web site.
My break
doesn't work here. when IPs are finished it goes and again reads first line of IpList.txt
... why?