This code opens the url and appends the /names
at the end and opens the page and prints the string to test1.csv
:
import urllib2
imp
The csv.writer class takes an iterable as it's argument to writerow; as strings in Python are iterable by character, they are an acceptable argument to writerow, but you get the above output.
To correct this, you could split the value based on whitespace (I'm assuming that's what you want)
csvwriter.writerow(JD.split())