Used the following to fix the problems (for the remaining issues, will change my code around). Sorry for the improper code format in my initial post.
import csv, re, mechanize
htmlML = br.response().read()
#escaping ? fixed the regex match
patMemberName = re.compile('<a href=/foo.php\?XID=(d+) ><font color=#000000><b>(.*) </b>')
searchMemberName = re.findall(patMemberName,htmlML)
MembersCsv = 'path-to-csv'
MemberWriter = csv.writer(open(MembersCsv, 'wb')) #adding b fixed the \n in csv
for i in searchMemberName:
MemberWriter.writerow(i)
print (i)
Thank you for your time
tags. also tried backticks (as per instructions)... using
tags stopped the formatter from asking me to "press ctrl+K"
– k3rb3r05 Nov 15 '11 at 07:14` tags just aren't cutting it.
– Alan Moore Nov 15 '11 at 07:43tags. Only recently noticed the difference between my post and the answers I received, so went looking... Anyway, it should be fixed now.
– k3rb3r05 Nov 15 '11 at 07:49