Jump to content

Help with ie code


new002
 Share

Recommended Posts

Hi I am complete new to autoit and I was trying to make a script to click on an image on a website and than click on a button on the webpage the image lead to.

To click on the image I made this

#include <ie.au3>

$oIE = _IECreate ("http://blackdragon-project.net/blackdragon/")
_IEImgClick ($oIE, "http://top.emu-fr.com/wow/button.php?u=new001")

And than to click on the button

#include <ie.au3>

$oIE = _iecreate("http://top.emu-fr.com/wow/index.php?a=in&u=dimple")
_IELinkClickByText ($oIE, "Entrer et Voter")

What I want to do is to combine the two into just one peace of code but when I try this

#include <ie.au3>

$oIE = _IECreate ("http://blackdragon-project.net/blackdragon/")
_IEImgClick ($oIE, "http://top.emu-fr.com/wow/button.php?u=new001")
_IELinkClickByText ($oIE, "Entrer et Voter")

I am stuck at the page http://top.emu-fr.com/wow/button.php?u=new001.

Thanks a lot for help.

Link to comment
Share on other sites

Thanks for help I tried this

#include <ie.au3>

$oIE = _IECreate ("http://blackdragon-project.net/blackdragon/")
_IENavigate ($oIE, "http://top.emu-fr.com/wow/index.php?a=in&amp;u=new001")
_IELinkClickByText ($oIE, "Entrer et Voter")

But now I am stuck at fist page. :)

Link to comment
Share on other sites

@new002

That doesnt work at all...

#include <IE.au3>
$oIE = _IECreate("http://blackdragon-project.net/blackdragon/", 0, 1, 1)

;Click on IMG by full src string
_IEImgClick($oIE, "http://top.emu-fr.com/wow/images/button.gif")

;Click on IMG by src sub-string
_IEImgClick($oIE, "button.gif", "src", 0 ,1)

;Click on IMG by name
_IEImgClick($oIE, "Sans titre", "name", 0 ,1)

;Click on IMG by Alt text
_IEImgClick($oIE, "TOP10 Emu-FR :: Serveur WoW", "alt", 0 ,1)


$oIE = _IECreate("http://blackdragon-project.net/blackdragon/", 0, 1, 1)

;Click on IMG by full src string
_IEImgClick($oIE, "http://www.gowonda.com/vote.gif")

;Click on IMG by src sub-string
_IEImgClick($oIE, "vote.gif", "src", 0 ,1)

Cheers, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Yes the first image I got it working thanks for the example the problem is the green button on this page: http://top.emu-fr.com/wow/index.php?a=in&u=new001

I need to click it but with debug bar I got this

<A class=cssbuttongo href="http://top.emu-fr.com/wow/index.php?a=in&amp;u=new001&amp;sid=b5lIJY0ubwatBC3wap0TRZg0vS1r90II">Entrer et Voter</A>

I do not think it is an image and I have no idea how to click it

I did this has a temporary solution

$oIE = _IECreate ("http://blackdragon-project.net/blackdragon/")
_IEImgClick ($oIE, "TOP10 Emu-FR :: Serveur WoW", "alt")
WinWaitActive("Page Piège du topsites - Windows Internet Explorer")
Send ("{TAB}")
sleep (500)
send ( "{TAB}" )
sleep ( 500 )
send ( "{TAB}" )
sleep ( 500 )
send ( "{TAB}" )
sleep ( 500 )
send ( "{TAB}" )
sleep ( 500 )
send ( "{TAB}" )
sleep ( 500 )
send ( "{TAB}" )
sleep ( 500 )
send ( "{TAB}" )
sleep ( 500 )
send ( "{TAB}" )
Send ("{ENTER}")
sleep (1500)
_IEQuit ($oIE)

I send some tab to get the button but it is ugly and does not always work.

Is there any other way to click on the link "entrer et voter"

Thanks.

Link to comment
Share on other sites

You're on the right track here, you simply need to attach to the new IE window...

$oIE = _IECreate ("http://blackdragon-project.net/blackdragon/")
_IEImgClick ($oIE, "TOP10 Emu-FR :: Serveur WoW", "alt")
WinWaitActive("Page Piège du topsites - Windows Internet Explorer")
$oIE2 = _IEAttach("Page Piège du topsites")
_IELoadWait($oIE2)
_IELinkClickByText ($oIE2, "Entrer et Voter")
_IEQuit ($oIE)

The _IELoadWait insures that the page has loaded and the voting link exists before trying to click 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

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...