I have a python script which contains the following part-
import csv
import mechanize
"""
some code here
"""
with open('data2.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV:
response2 = browser.open(surl+"0"+row[0])
str_response = response2.read()
if "bh{background-color:" in str_response :
print "Not Found"
else :
print "Found " + row[0]
s_index=str_response.find("fref=search")+13
e_index=str_response.find("</a><div class=\"bm bn\">")
print str_response[s_index:e_index]
When I'm trying to run this file, it shows there's an error in the line
str_response = response2.read()
It says-
str_response = response2.read() ^ IndentationError: unexpected indent
I'm newbie in python and can not figure out what is the right indentation for this piece of code. Anyone have any idea what I'm doing wrong here?