Jump to content

IE and java onclick links


Recommended Posts

how to click to this links&

i can crush my brain

read of many topics in this forum, but the question is still open

the HTML

CODE
<table>

<tr bgcolor="c0c0ff"><td align="center" class="fancybrd"><a onclick="_view();">Return</a> | <a onclick="_copy('9637');">Copy</a> | <a onclick="_edit('9637');">Edit</a> | <a onclick="_delete('9637');">Delete</a> | <a onclick="_print2('9637');">Print</a></td></tr>

</table>

more HTML code and java-script in attach

Link to comment
Share on other sites

Please show your code and the exact output to the SciTe console.

Also, that is Javascript - not Java. There is a big difference.

Looks like you should look at _IELinkClickByText

Dale

Edit: typo

Edited by DaleHohm

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

Link to comment
Share on other sites

my code

#include <IE.au3>
$oIE=ObjCreate("InternetExplorer.Application.1")
With $oIE
    .Visible=1
    .Top = (@DesktopHeight-400)/2
    .Height=400         
    .Width=600
    .Silent=1          
    $IEWnd=HWnd(.hWnd) 
EndWith


$oIE.Navigate( "file:///C:\Documents and Settings\Администратор\Рабочий стол\RAB\page.html" )  
_IELoadWait($oIE)
$oInputs= $oIE.document.body.getElementsByTAGName("A")
For $oInput in $oInputs
    ConsoleWrite($oInput.name & @CRLF)
    If $oInput.name = "Edit" Then
    ConsoleWrite("BINGO!!!")
    ;$oInput.obj.click()                                   ;here is place where i think a link be clicked
    ExitLoop
   EndIf
NextoÝ÷ Øz0¶%É(Øb²X§Ê'²^¢ëiº×(uæèÆjºBÓÝ®+jabë4÷`.¶-ßOvIÈOvëh"ÝÖ­ªiz½=Ø­ wZ¶©¥êÞÅꮢßëºé®ºè­+]:ëz®¢Ð´÷`èréÛԶاÍ=Û]8Ó];ë]

CODE
>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Documents and Settings\Администратор\Рабочий стол\RAB\test1.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams

+> Starting AutoIt3Wrapper v.1.7.3

>Running AU3Check (1.54.6.0) params: from:C:\Program Files\AutoIt3

+>AU3Check ended.rc:0

>Running:(3.2.2.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\Администратор\Рабочий стол\RAB\test1.au3"

--> IE.au3 Warning from function _IELinkClickByText, $_IEStatus_NoMatch

+>AutoIT3.exe ended.rc:0

>Exit code: 0 Time: 1.824

{TAB} not works too.

(my English is bad, sorry)

Edited by cannibaloid
Link to comment
Share on other sites

this code is work :)

#include <IE.au3>
$oIE=ObjCreate("InternetExplorer.Application.1")
With $oIE
    .Visible=1
    .Top = (@DesktopHeight-400)/2
    .Height=400         
    .Width=600
    .Silent=1          
    $IEWnd=HWnd(.hWnd) 
EndWith


$oIE.Navigate( "file:///C:\Documents and Settings\Администратор\Рабочий стол\RAB\page.html" )  
_IELoadWait($oIE)
$oInputs= $oIE.document.body.getElementsByTAGName("A")
For $oInput in $oInputs
    ConsoleWrite($oInput.name & @CRLF)
    If $oInput.name = "Edit" Then
    _IEAction($oInput, "click") :idea: 
    ConsoleWrite("BINGO!!!")
    ExitLoop
   EndIf
Next

I think that I have not had time to eat your brain :D

Edited by cannibaloid
Link to comment
Share on other sites

Try _IELinkClickByText($oIE, "Edit")

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

Link to comment
Share on other sites

This code works right

#include <IE.au3>
$oIE=ObjCreate("InternetExplorer.Application.1")
With $oIE
    .Visible=1
    .Top = (@DesktopHeight-400)/2
    .Height=400         
    .Width=600
    .Silent=1         
    $IEWnd=HWnd(.hWnd)
EndWith

$oIE.Navigate( "file:///C:\Documents and Settings\cannibal\Рабочий стол\RAB\page.html" ) 
_IELoadWait($oIE)
$oInputs= $oIE.document.body.getElementsByTAGName("A")
For $oInput In $oInputs
   If $oInput.innertext="delete" Then
    _IEAction($oInput, "click")
    ConsoleWrite("BINGO!!!")
   EndIf
Next
Link to comment
Share on other sites

I'm sorry, you are not sharing enough information to help you.

Please work through the examples for _IECreate, IEBodyReadHTML and _IELinkClickByText until you understand them and can apply them to your situation. Then come back and pose a more detailed question with sample code and page source if necessary.

Dale

Edit: typo

Edited by DaleHohm

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

Link to comment
Share on other sites

Dale, if you forgive me, i can little midify your function _IELinkClickByText

It now looks so. Also does that that I want as it is necessary

Func _IELinkClickByText(ByRef $o_object, $s_linkText, $i_index = 0, $f_wait = 1)
    If Not IsObj($o_object) Then
        __IEErrorNotify("Error", "_IELinkClickByText", "$_IEStatus_InvalidDataType")
        SetError($_IEStatus_InvalidDataType, 1)
        Return 0
    EndIf
    ;
    Local $found = 0, $link, $linktext, $links = $o_object.document.body.getElementsByTAGName("A")
    $i_index = Number($i_index)
    For $link In $links
        $linktext = $link.innertext & "" ; Append empty string to prevent problem with no outerText (image) links
        If $linktext = $s_linkText Then
            if ($found = $i_index) Then
                $link.click
                If $f_wait Then
                    _IELoadWait($o_object)
                    SetError(@error)
                    Return -1
                EndIf
                SetError($_IEStatus_Success)
                Return -1
            EndIf
            $found = $found + 1
        EndIf
    Next
    __IEErrorNotify("Warning", "_IELinkClickByText", "$_IEStatus_NoMatch")
    SetError($_IEStatus_NoMatch) ; Could be caused by parameter 2, 3 or both
    Return 0
EndFunc   ;==>_IELinkClickByText
Edited by cannibaloid
Link to comment
Share on other sites

You're certainly welcome to use the code in any any you wish. It is not clear what you did or why however. I do see that you changed it to collect "A" tags instead of using the links collection (which includes image maps).

I'm glad you have what you need.

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...