Extract urls from log

f=open("aggregation.spider.processor.log","r")
count=0
errors=[]
while(True):
	line_feed=f.readline()
	if(line_feed):
		if(line_feed.find("processor-not-found-disabled-url")>-1):
			line_feed = line_feed.split(" url:")
			line_feed = line_feed[1]
			line_feed = line_feed.split(",")
			line_feed = line_feed[0]
			line_feed.strip()
			errors.append(line_feed)
	else:
		break
errors.sort()
for x in errors:
	f=open("url", "a+")
	f.write(x)
	f.close()
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: