Jump to content
Sign in to follow this  
Jester009

_IELinkClickByText Problem

Recommended Posts

Jester009

Hi guys,

I'm trying to click on the download now link in the following page.

http://www.download.com/AVG-Anti-Virus/3000-2239_4-10385707.html?tag=mncol;rbxcrdl1

I tried to use _IELinkClickByText and _IETagNameGetCollection but none seem to be working.

$oIE = _IEAttach("AVG")
$oPaths = _IETagNameGetCollection ($oIE, "A")

For $oPath In $oPaths
    If StringInStr($oPath.className, "dlNowIcon", 1) > 0 Then
        _IEAction($oPath, "click")
    EndIf
Next

Can any of you explain why this does not prompt me the file download dialog box?

Thanks in advance.

Jester009

Share this post


Link to post
Share on other sites
DaleHohm

Any messages to the SciTe console? Does it ever execute your _IEAction? (use consolewrite, msgbox or SciTe debug mode to see what gets run).

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
Jester009

Hi Dale thanks a lot for replying.

Yeah, It performs the _IEAction. The page redirects to the landing page. But I do not get the File Download dialog box.

But when I click manually, I get the dialog box

:)

Share this post


Link to post
Share on other sites
DaleHohm

I would first wonder if you are clicking on the correct link. Many objects can hve the same className.

suggest you:

For $oPath In $oPaths
    ConsoleWrite($oPath.className & @CR)
Next

to verify

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
Jester009

Hi Dale,

I have gone through the page source. Only the download link has the className "dlNowIcon"

I tried click the "DIV" surrounding the link as well. But that does not even give me the landing page.

:)

Thanks

Share this post


Link to post
Share on other sites
DaleHohm

Don't know how you got the page source and it is easy to be fooled by dynamically generated HTML. Please run the code snippet I supplied.

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
Jester009

ok sir. :) I tried the snippet you provided me. This is the result.

0
0
0
0
0
0
dlNowIcon
0
toolTipElement
0
dlnl
edRate5
userRate3h userRateInline
0
addtowatch
toolTipElement
0
0
0
0
0
0
0
0
0
0
0
0
0
readMore
0
0
0
0
0
0
userRate3h
userStars userRate0
flexButton
readMore
0
userRateSm1
0
0
submitHelpful
submitHelpful
report toolTipElement
email toolTipElement
permalink toolTipElement
reply
userRateSm3
0
0
submitHelpful
submitHelpful
report toolTipElement
email toolTipElement
permalink toolTipElement
reply
userRateSm1
0
0
submitHelpful
submitHelpful
report toolTipElement
email toolTipElement
permalink toolTipElement
reply
userRateSm4
0
0
submitHelpful
submitHelpful
report toolTipElement
email toolTipElement
permalink toolTipElement
reply
userRateSm5
0
0
submitHelpful
submitHelpful
report toolTipElement
email toolTipElement
permalink toolTipElement
reply
readMore
flexButton
close closeSticky
closeSticky
flexButton submitButton
0
userStars userRate0
0
flexButton submitButton
0
flexButton submitButton
0
flexButton submitButton
0
0
flexButton submitButton
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
logOut
rblogo
siteId4logo siteLogo
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

I used the debubbar in your sig to check the source

Edited by Jester009

Share this post


Link to post
Share on other sites
DaleHohm

Thanks.

Ok, better test...

$oIE = _IEAttach("AVG")
$oPaths = _IETagNameGetCollection ($oIE, "A")

For $oPath In $oPaths
    If StringInStr($oPath.className, "dlNowIcon", 1) > 0 Then
        ConsoleWrite(_IEPropertyGet($oPath, "outerhtml") & @CR)
        _IEAction($oPath, "click")
    EndIf
Next

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
Jester009

Done. This the output...

<A class=dlNowIcon onclick="return RBDL.downloadNow('http://software-files.download.com/sd/0WdQUaMn4rp-3n3zurK4tTsmVsKw7nQzaEfygYA9mdiYlCjOpvU-f70jAKpcTBNfOg7MCOnkObomRa4QVp2qwLmkqiq2DQlt/software/10824764/10385707/3/avg_avwt_stf_all_8_87a1276_cnet.exe?lop=btn&amp;ptype=1900&amp;ontid=2239&amp;siteId=4&amp;edId=3&amp;spi=f03a831723c9e0122722ce634e4c898e&amp;pid=10824764&amp;psid=10385707',
                                                                'http://dw.com.com/redir?edId=3&amp;siteId=4&amp;oId=3000-2239_4-10385707&amp;ontId=2239_4&amp;spi=f03a831723c9e0122722ce634e4c898e&amp;lop=btn&amp;tag=tdw_dlicon&amp;ltype=dl_dlnow&amp;pid=10824764&amp;mfgId=6270610&amp;merId=6270610&amp;pguid=wgPtjQoPjF0AAH8PLTMAAACk&amp;destUrl=http%3A%2F%2Fwww.download.com%2F3001-2239_4-10824764.html', '0')" href="http://dw.com.com/redir?edId=3&amp;siteId=4&amp;oId=3000-2239_4-10385707&amp;ontId=2239_4&amp;spi=f03a831723c9e0122722ce634e4c898e&amp;lop=btn&amp;tag=tdw_dlicon&amp;ltype=dl_dlnow&amp;pid=10824764&amp;mfgId=6270610&amp;merId=6270610&amp;pguid=wgPtjQoPjF0AAH8PLTMAAACk&amp;destUrl=http%3A%2F%2Fwww.download.com%2F3001-2239_4-10824764.html%3Fspi%3Df03a831723c9e0122722ce634e4c898e"><IMG src="http://i.i.com.com/cnwk.1d/i/tron/download/dlNowGrn.gif"></A>

Share this post


Link to post
Share on other sites
DaleHohm

Popup-blocker.

On my machine it is activated when doing a scripted click, but not with the mouse.

Try disabling (I had more than one) and try again.

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
Jester009

Hi Dale,

It's already turned off...

Any idea??

Share this post


Link to post
Share on other sites
DaleHohm

OK, not a popup blocker, but your friendly IE Information Bar.

After the pop-up blocker was disabled, I managed to catch the small popup window that appears and read the info in the info bar. It was truncated, but I got enough of it. It said: "to help protect your security, internet explorer has restricted this site from sh..."

In the IE helpfile you'll find a section called "Understanding the Internet Explorer Information bar". In here you'll find (formatting lost):

Can I turn off the Information bar?

Yes, you can, but we don't recommend it. If you do want to turn it off, you have to turn it off for each type of message.

To turn off Information bar messages about blocked pop-up windows

Open Internet Explorer.

Click the Tools button, click Pop-up Blocker, and then click Pop-up Blocker Settings.

Clear the Show Information Bar when a pop-up is blocked check box, and then click Close.

To stop the Information bar from blocking file and software downloads

Open Internet Explorer.

Click the Tools button, and then click Internet Options.

Click the Security tab, and then click Custom level.

Do one or both of the following:

To turn off the Information bar for file downloads, scroll to the Downloads section of the list, and then, under Automatic prompting for file downloads, click Enable.

To turn off the Information bar for ActiveX controls, scroll to the ActiveX controls and plug-ins section of the list, and then, under Automatic prompting for ActiveX controls, click Enable.

Click OK, click Yes to confirm that you want to make the change, and then click OK again.

Once I enabled "Automatic prompting for file downloads", things worked as they would with a mouse click.

If you cannot or do not want to change this security setting, you may want to use the standard AutoIt MouseClick() instead. The the example for _IEPropertyGet to find the screen coordinates, height and width of the link so that you can click in the middle of it.

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
Jester009

WOW. Dale you are the man. It works. I can't remember how many hours I wasted on this.

Thanks a million.

:)

Share this post


Link to post
Share on other sites
philphil61

Hi,, I know this is an old topic but I've searched and tried different methods including here.

I'm a noob, a novice with scripting - I'm trying ;) honest!

My script - why I want to create it? becoz I maintain several pc's from friends/acquaitances and always use the same software to install for checking updates, cleaning and defragging... Filehippo Update Checker, CNET TechTracker and Secunia PSI to check all updates (each miss certain programs so I install and run all) then CCleaner, Wise Registry and Disk Cleaner then MyDefrag.

What I want it to do? check if installed, if not installed download and install then run.... simple? yes I got as far as Filehippo's UpdateChecker tested and working but it's the same problem as above ... with download.com - I can't find the right "function/instruction" to get the mouse to click the green "dlNowIcon" button

Is this _IETagNameGetCollection browser specific? if so how can i make this work on default browser?

If it's not browser specific - all I need is the code to find "dlNowIcon" and click it........ but nothing seems to work (I use chrome as default browser but even trying IE9 as default - still nothing)

if FileExists(@AppDataDir & "\CBS Interactive\CNET TechTracker\TechTracker.exe") Then
Run(@AppDataDir & "\CBS Interactive\CNET TechTracker\TechTracker.exe")
Else
Run("http://www.cnet.com/techtracker-free/")
WinWaitActive("CNET TechTracker - the easiest way to keep software up-to-date")

then i'm lost?? :graduated:

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.