i have a redirection url
www.test.com
it will redirect me to
www.test.com/XXYYXXYY
ans every time when i open it will redirect me to a new url ( XXYYXXYY will change every time )
so i want to save them into a CSV file
import urllib2
import csv
import sys
url = 'http://www.test.com'
u = urllib2.urlopen(url)
localFile = open('file.csv', 'w')
localFile.write(u.read())
localFile.close()
is this a correct code ?
thank you