RickyD Posted February 26, 2010 Posted February 26, 2010 (edited) I have a web page that I need to get some information from. I've been successful for any information that is actually part of the HTML page (table entries, links, etc.)However, there are a couple of pieces of information that the server side has embedded into an external javascript file. "DebugBar" shows me the script contents, which is how I found what I needed in the first place. I can get the URL of the javascript source file from the document.scripts DOM collection. However, I can't figure out how to read the contents of the script into AutoIt. I've played with InetGet() but haven't had any luck. Is there a way to get the script source directly out of IE?Thanks,Rick Edited February 27, 2010 by RickyD
PsaltyDS Posted February 28, 2010 Posted February 28, 2010 The scripts are not included in the data from _IEDocReadHTML()? Note that is not _IEBodyReadyHTML(). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
RickyD Posted March 3, 2010 Author Posted March 3, 2010 The scripts are not included in the data from _IEDocReadHTML()? Note that is not _IEBodyReadyHTML().No, since they are external scripts. All I seem to be able to get is the URL of the script file, not the script text itself.Rick
PsaltyDS Posted March 3, 2010 Posted March 3, 2010 No, since they are external scripts. All I seem to be able to get is the URL of the script file, not the script text itself.Hmm. I would have expected that to be prevented from working by cross-site scripting protections. But I'm not a web guy. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
DaleHohm Posted March 3, 2010 Posted March 3, 2010 Here's some magic... $sScriptText = $oIE.document.parentwindow.eval("decodeURI('" & $sFullJSFileURL & "');") Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
PsaltyDS Posted March 3, 2010 Posted March 3, 2010 Dale is indeed strong with the IE side of The Force! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now