Downloading html while triggering special configuration ( sending cookies perhaps? )

Jan 4, 2017 at 2:54am
Hello everyone!

Downloading html is not quite a challange.
We can just use URLDownloadToFile function from
https://msdn.microsoft.com/en-us/library/ms775123(v=vs.85).aspx

I'm trying to make a program to download forex news from forex factory calendar.
Here's the link:http://www.forexfactory.com/calendar.php?day=dec8.2016

Its very easy to select the date by just formating the part of the url
where date is and then calling URLDownloadToFile however
I find it rather difficult to convert timezones and was hoping perhaps
it would be possible to change the calendar timezone with a program.

Here's a picture showning how to manually change the timezone using browser:
https://www.upload.ee/image/6519506/111.jpg

How could I change the timezone c++/windows sdk and download that html?
If I could somehow send cookie information before downloading html, I would know exactly what to do.
Thanks!
Last edited on Jan 4, 2017 at 2:58am
Jan 4, 2017 at 9:46am
I had a look at the website but couldn't see a way to change the timezone. I guess you can do it only when you are logged in. You can automate a website by using a webbrowser control. However in plain C this is really difficult(COM). If you are not fainthearted have a look:
https://www.codeproject.com/articles/3365/embed-an-html-control-in-your-own-window-using-pla
Much easier if you could use MFC or .NET
Jan 5, 2017 at 12:55am
I'm not logged into the webside, did you looked into image and pressed the clock what red arrow shows in picture?

I think getting control over html can be even more absurd, Is there anyway to download html while sending the cookie like browsers do?
Jan 5, 2017 at 9:11am
Is there anyway to download html while sending the cookie like browsers do?

I am not aware of one. Cookies are sent from the browser to the server, but only if the website sent a cookie in the first place. Since this website does not send cookies, what could you send ?
Feb 8, 2017 at 6:04am
You could use libcurl, wininet (this is what internet explorer uses) or winhttp:
https://curl.haxx.se/libcurl/
https://msdn.microsoft.com/en-us/library/windows/desktop/aa385483(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/aa382925(v=vs.85).aspx



Libcurl is very simple to use and there are already pre-written examples.
Topic archived. No new replies allowed.