URL does not work with formatted string but plain string does

74 views Asked by At

I am trying to dowload data from Yahoo finance using the following link that I am generating-

url_begin = "http://ichart.finance.yahoo.com/table.csv?s="      
url_end = "&a=%s&b=%s&c=%s&d=%s&e=%s&f=%s" % (Start_Month, Start_Day, Start_Year, End_Month, End_Day, End_Year)     
i=TICKR    
link_created = "%s%s%s"  % (url_begin, i, url_end)  #Forge downloadable link.

When I run it, I am getting error 404 : No page found.

If I substitute url_end with url_end = "&a=05&b=08&c=2015&d=06&e=08&f=2015"

it works.

I don't understand why the first url_end does not work. Can anyone help me to fix it?

0

There are 0 answers