AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Source Code to Variable

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Tyrsius



Joined: 09 Jul 2009
Posts: 140

PostPosted: Tue Mar 02, 2010 12:50 am    Post subject: Source Code to Variable Reply with quote

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.
Back to top
View user's profile Send private message
answer4u
Guest





PostPosted: Tue Mar 02, 2010 1:12 am    Post subject: Reply with quote

Does the following javascript give you the source you want if you navigate to it?
Code:
javascript: alert( document.documentElement.outerHTML )
Back to top
Tyrsius



Joined: 09 Jul 2009
Posts: 140

PostPosted: Tue Mar 02, 2010 1:41 am    Post subject: Reply with quote

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")
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group