这是我的python脚本的一部分:
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
我将从bing网站处理我的主机。
我的break
在这里不起作用。当IP完成时,它会再次读取IpList.txt
的第一行......为什么?