Jump to content
Sign in to follow this  
apollopimp

Automated click inside a web page javascript

Recommended Posts

apollopimp

here is the source for the button from the web page using DeBugBar ..

ive been trying to figure out how to make this button refresh every 10 seconds without it using the mouse the name of the button is Refresh.

<A style="COLOR: #fff; TEXT-DECORATION: underline" href="javascript:Site.deleteCache();Site.reload()">Refresh</A>

hope someone can help me with this thanks

Edited by apollopimp

Share this post


Link to post
Share on other sites
apollopimp

that refreshes the whole page and reloads to a different page than i am trying to refresh..

The refresh button on the web page only refreshes the info on the page in the same frame..

Share this post


Link to post
Share on other sites
DaleHohm

_IELinkClickByText


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
apollopimp

_IELinkClickByText

how would i use that

i have no clue what i am doing i have tried many different things here is one

#include <IE.au3>

$oIE = _IEAttach ("Demon Slayer by Chris on MySpace Apps", "embedded")

_IELinkClickByText ($oIE, "Refresh")

how would i attach to my page and than use _IELinkClickByText to find the Refresh and click on it?

Share this post


Link to post
Share on other sites
DaleHohm

You show the code you tried (good), but don't describe the results - including messages in the SciTe console (bad).

You mention Frames, so you may need to look at _IEFrameGet* functions.

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
apollopimp

what would be the best info from DeBugBar for me to post here so we can figure out what i need to do..

Share this post


Link to post
Share on other sites
Authenticity

I guess that it's sufficient to do something like:

$oIE.document.parentwindow.eval('Site.deleteCache();Site.reload();')

or just navigating to this javascript:

_IENavigate($oIE, 'javascript: Site.deleteCache();Site.reload();')

For example:

#include <IE.au3>

Global $oIE = _IECreate()
Global $sHTML = _GenHTML()
_IEDocWriteHTML($oIE, $sHTML)

$oIE.document.parentwindow.eval("myFunc();myFunc();")

While _IEPropertyGet($oIE, 'visible')
    Sleep(20)
WEnd
Exit

Func _GenHTML()
    Local $s_HTML = ""
    
    $s_HTML &= "<HTML>" & @CRLF
    $s_HTML &= "<HEAD></HEAD>" & @CRLF
    $s_HTML &= "<BODY><INPUT TYPE=button VALUE='Test' onclick='javascript: myFunc()'>" & @CRLF
    $s_HTML &= "<script TYPE='text/javascript'>" & @CRLF
    $s_HTML &= "function myFunc(){" & @CRLF
    $s_HTML &= "alert('Test');" & @CRLF
    $s_HTML &= "}" & @CRLF
    $s_HTML &= "</SCRIPT>" & @CRLF
    $s_HTML &= "</BODY>" & @CRLF
    $s_HTML &= "</HTML>"

    Return $s_HTML
EndFunc

Share this post


Link to post
Share on other sites
apollopimp

Thanks but i have no clue how to add the right info to make that work for me

here a screen shot of the DOM tree just hoping it might help

Posted Image

Edited by apollopimp

Share this post


Link to post
Share on other sites
apollopimp

is there anyone that can help some more with this?

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.