Sign in to follow this  
Followers 0
new002

Help with ie code

11 posts in this topic

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.

Share this post


Link to post
Share on other sites



@new002

Why do you use the link of web for _IEImgClick ? Use url of picture...

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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. :)

Share this post


Link to post
Share on other sites

@new002

Where is _IEImgClick ?... :)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Sorry I misunderstood you.

So now I have this

#include <ie.au3>
$oIE = _IECreate ("http://blackdragon-project.net/blackdragon/")
_IEImgClick ($oIE, "TOP10 Emu-FR :: Serveur WoW", "alt")
_IELinkClickByText ($oIE, "Entrer et Voter")

But I am stuck at the page http://top.emu-fr.com/wow/index.php?a=in&u=new001

It doesn't want to click on the green button.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

@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

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Oui mais voilà le problème je trouve pas le lien de l'image du bouton vert "Entrer et Voter".

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

@new002

Maybe...

MouseClick()

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

That made it thanks a lot for the great help.

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  
Followers 0