| View previous topic :: View next topic |
| Author |
Message |
Tyrsius
Joined: 09 Jul 2009 Posts: 140
|
Posted: Tue Mar 02, 2010 12:50 am Post subject: Source Code to Variable |
|
|
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 |
|
 |
answer4u Guest
|
Posted: Tue Mar 02, 2010 1:12 am Post subject: |
|
|
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
|
Posted: Tue Mar 02, 2010 1:41 am Post subject: |
|
|
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 |
|
 |
|