Web Page Saves Are Different Via com Versus URLDownloadToFile Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
thomastthai
Posts: 18
Joined: 12 Mar 2020, 01:51

Web Page Saves Are Different Via com Versus URLDownloadToFile

11 May 2020, 06:01

I succeeded in using RegExMatch on a web page that was downloaded via URLDownloadToFile. Then I used the same needle on a haystack gotten from the same URL using:

Code: Select all

haystack := ie.document.documentElement.outerHTML
That second RegExMatch failed. To my surprise, the HTML content wasn't the same!

I diff-ed the two files to verify.

Hopefully, this post will save someone hours of being confused.
Screenshot (4).png
Screenshot (4).png (160.76 KiB) Viewed 373 times
gregster
Posts: 9114
Joined: 30 Sep 2013, 06:48

Re: Web Page Saves Are Different Via com Versus URLDownloadToFile  Topic is solved

11 May 2020, 06:40

Yeah, URLDownloadToFile can't really account for code that dynamically changes via user interaction and javascript. And iframes are tricky anyway.

But you are saying URLDownloadToFile was better in this case? Probably you didn't get the html of the iframe with your line haystack := ie.document.documentElement.outerHTML I guess the iframe won't be available via the .documentElement - you might have to go further up the DOM tree to get it.
thomastthai
Posts: 18
Joined: 12 Mar 2020, 01:51

Re: Web Page Saves Are Different Via com Versus URLDownloadToFile

11 May 2020, 15:03

Thank you @gregster for taking the time to share your thoughts. Those are excellent reminders to think about how the needle will be impacted by the changes in user interaction, iframe, and Javascript.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: bobstoner289, Google [Bot], peter_ahk and 324 guests