Jump to content
Sign in to follow this  
toxicdav3

Getting links created by javascript

Recommended Posts

toxicdav3

Hey, i need help getting links that are created with javascript. The current code i'm using is pretty much the example given from the help file. I guess it only reads the html. Any help would be appreciated!

#include <IE.au3>

$oIE = _IECreate ("http://example.com")

$oLinks = _IELinkGetCollection ($oIE)

$iNumLinks = @extended

MsgBox(0, "Link Info", $iNumLinks & " links found")

For $oLink In $oLinks

MsgBox(0, "Link Info", $oLink.href)

Next

Share this post


Link to post
Share on other sites
DaleHohm

If they aren't html, they aren't links. Javasctipt can create them dynamically. Suggest you try DebugBar.

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

Share this post


Link to post
Share on other sites
DaleHohm

You don't understand what you are asking well enough to understand DebugBar or the answer I gave.

Prove me wrong and I'll be happy to help further.

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

Share this post


Link to post
Share on other sites
toxicdav3

I do understand though. I need a way of getting links from a page that has been processed by the browser, but i do not have a way atm or know how to do it. Autoit only gets the original source when interacting with IE. Even though DebugBar is able to do this, it is no help to me as i can't implement it into my code as far as i know.

Edited by toxicdav3

Share this post


Link to post
Share on other sites
Will66

Autoit only gets the original source when interacting with IE.

Not true, the DOM is always available

Share this post


Link to post
Share on other sites
Neo

toxicdav3, I don't think you should question Master Dale Hohm, he created the IE.au3 that we all use and love to use.

It could be that before you do an _IELinkGetCollection($oFrameBody) on your page, you need to get to the correct Frame as if you page uses frames you might not be able to obtain the links you want.

Let us know if you need more help.

Share this post


Link to post
Share on other sites
metalicaman8

http://www.mjtnet.com/software/imglib104.exe

This installer includes easy to read examples in a language I'm not familiar with but could understand enough to use the included dll. It can take a screenshot of an area you define (the link you want to click) find that picture inside your screen and click the middle of that area. It includes a program to take the screenshots. It is an installer.

Share this post


Link to post
Share on other sites
GEOSoft

You will have to look at the page source and see just where the javascript links are. If they are being created in the <Head> tag then I think there is a function to get the inner-text of the head section of the page. Else you will have to parse the source code to get them.

If they are in an external js file then it will be trickier. You will have to get the link to the js file, then use InetGet() and parse that file.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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  

×