I'm trying to convert a YQL string with spaces to html code.
Here's the YQL string I'm using:
select * from yahoo.finance.historicaldata where symbol in ("MSFT", "AAPL") and startDate = "2010-10-01" and endDate = "2010-10-05"
Here's the url code that needs to come out:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.historicaldata%20where%20symbol%20in%20(%22MSFT%22%2C%20%22AAPL%22)%20and%20startDate%20%3D%20%222010-10-01%22%20and%20endDate%20%3D%20%222010-10-05%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=
I've been trying to do this with urllib.parse.urlencode but have not had any luck.
I can get up to "http://query.yahooapis.com/v1/public/yql?" but afterwards it starts to break down. Is there a pythonesque way to do this that I'm just missing?
Thank you!