AutoHotkey Community

It is currently May 27th, 2012, 4:32 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Source Code to Variable
PostPosted: March 2nd, 2010, 1:50 am 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
I am looking for any method of pulling the source code from a page directly into a variable. Right now I am opening the source code with the browser built-in "view source code" which opens it in notepad. This method seems poor.

The page has generated content, so URLDownloadtoFile and FileRead will not work.

I have already done some (small) work with the COM and iWeb AHK libraries, so if either of those have a solution for this it would probably be preferable.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2010, 2:12 am 
Does the following javascript give you the source you want if you navigate to it?
Code:
javascript: alert( document.documentElement.outerHTML )


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 2nd, 2010, 2:41 am 
Offline

Joined: July 9th, 2009, 1:13 am
Posts: 140
Thanks, that got me exactly what I needed!

just in case someone happens upon this thread in the future, the code looks like this


Code:
pagesource := Com_Invoke(pwb, "document.documentElement.outerHTML")


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Mickers, rbrtryn and 66 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group