Jump to content
Sign in to follow this  
squirrel

Saving DOM to file (_IE)

Recommended Posts

squirrel

Hi everybody,

I am new to AutoIt and already love it!

The situation

What I am currently trying to do is to crawl parts of a website. The site I am trying to crawl makes intensive use of Ajax to load additional content. I have written an AutoIt-script using the "_IE"-libraries, which fires these Ajax-content-load processes. Everything works fine and i can see the post-loaded HTML in the browser.

The Problem

But now I have the problem, that I cannot access the modified DOM-data. Just performing a "Save as..." via the file menu of the browser does not work, of course, since the modified DOM is ignored choosing this way.

The Question

What I am looking for is an approach to save/export/log the current DOM (or the single DOM changes) to the hard disk as a file.

I would be really happy, if somebody here has an idea!

Thank you very much in advance,

Chris

Share this post


Link to post
Share on other sites
squirrel

Thank you JohnOne - that function works perfect!

I first use _IEBodyReadHTML to get the HTML of the current (modified) DOM and store it in a local variable. Then I simply write that variable to a file using FileWrite.

Edited by squirrel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.