I'm trying to download file with Python (2.7) using code below - But why I get empty file? Can somebody point me the "leak" - what am I missing?
How to get original file with text inside?
import urllib2
url = 'https://www.dropbox.com/s/splz3vk9pl1tbgz/test.txt?dl=0'
user_agent = 'Mozilla 5.0 (Windows 7; Win64; x64)'
file_name = "test.txt"
u = urllib2.Request(url, headers = {'User-Agent' : user_agent})
f = open(file_name, 'wb')
f.close()