new002 Posted December 26, 2008 Share Posted December 26, 2008 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 More sharing options...
FireFox Posted December 26, 2008 Share Posted December 26, 2008 @new002 Why do you use the link of web for _IEImgClick ? Use url of picture... Cheers, FireFox. Link to comment Share on other sites More sharing options...
new002 Posted December 26, 2008 Author Share Posted December 26, 2008 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&u=new001") _IELinkClickByText ($oIE, "Entrer et Voter") But now I am stuck at fist page. Link to comment Share on other sites More sharing options...
FireFox Posted December 26, 2008 Share Posted December 26, 2008 @new002 Where is _IEImgClick ?... Cheers, FireFox. Link to comment Share on other sites More sharing options...
new002 Posted December 26, 2008 Author Share Posted December 26, 2008 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=new001It doesn't want to click on the green button. Link to comment Share on other sites More sharing options...
FireFox Posted December 26, 2008 Share Posted December 26, 2008 (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 December 27, 2008 by FireFox Link to comment Share on other sites More sharing options...
new002 Posted December 26, 2008 Author Share Posted December 26, 2008 Oui mais voilà le problème je trouve pas le lien de l'image du bouton vert "Entrer et Voter". Link to comment Share on other sites More sharing options...
new002 Posted December 27, 2008 Author Share Posted December 27, 2008 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=new001I 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&u=new001&sid=b5lIJY0ubwatBC3wap0TRZg0vS1r90II">Entrer et Voter</A>I do not think it is an image and I have no idea how to click itI 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 More sharing options...
FireFox Posted December 27, 2008 Share Posted December 27, 2008 @new002 Maybe... MouseClick() Cheers, FireFox. Link to comment Share on other sites More sharing options...
DaleHohm Posted December 27, 2008 Share Posted December 27, 2008 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 More sharing options...
new002 Posted December 27, 2008 Author Share Posted December 27, 2008 That made it thanks a lot for the great help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now