Hello. I want to be able to download some data from a site into a .txt, similar to how UrlDownloadToFile works. The reason why I can't use UrlDownloadToFile for this situation is that the info on the page changes without the url changing.
Here's what I want to happen.
I want to be able to download/copy the current value of the stop watch on https://www.timeanddate.com/stopwatch/ while I have the page open and running. Is there anyway to do this?
Download Dynamic Webpage Data to TXT
-
- Posts: 13
- Joined: 03 Apr 2021, 17:48
Re: Download Dynamic Webpage Data to TXT
Here’s how you could do it using Internet Explorer. Run the script below which will open the site in an IE browser window. Press Ctrl+Tab to save the HTML source to a file.
There are ways to do this using tools for automating other browsers, such as the Chrome.ahk library.
Code: Select all
wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := True
wb.Navigate("https://www.timeanddate.com/stopwatch/")
return
^Tab::
FileAppend, % wb.Document.All[0].outerhtml, % "html source_" A_Now ".txt"
MsgBox, Page source saved to a file in the script directory
return
There are ways to do this using tools for automating other browsers, such as the Chrome.ahk library.