airrs Posted August 1, 2012 Posted August 1, 2012 Hi, i'm testing some stuff for a bigger script at work. i need to open a page enter a text and click the button (for testing i used wikipedia) parsing the text is no problem, but the click doesent work. here my source. i hope someone can help me. #include Local $oIE = _IECreate("http://en.wikipedia.org/w/index.php?title=Special%3ASearch&profile=default&search=&fulltext=Search") Sleep(500) Local $oForm = _IEFormGetObjByName($oIE, "Search") Local $oText = _IEFormElementGetObjByName($oForm, "searchText") _IEFormElementSetValue($oText, "Test") Local $c = _IEGetObjById($oIE, "Search") _IEAction($c, "click")
EmptySpace Posted August 1, 2012 Posted August 1, 2012 $oButtons = _IETagNameGetCollection ($oIE, "INPUT") ; not sure about input For $oButton In $oButtons If $oButton.id = "search" Then _IEAction ($oButton, "click") ExitLoop EndIf Next Try something like this.
airrs Posted August 1, 2012 Author Posted August 1, 2012 Thanks for the fast answer, but it doesnt work either
EmptySpace Posted August 1, 2012 Posted August 1, 2012 What it says? try to put in func and call it where you need. it dont works for me too when I put it directly into code.
airrs Posted August 1, 2012 Author Posted August 1, 2012 (edited) it just opens IE, then wikipedia, then parse the text and then the script is done and nothing happens. I tried it with in a func, but it didnt do anything other than without it. No errors or anything else Edited August 1, 2012 by airrs
EmptySpace Posted August 1, 2012 Posted August 1, 2012 Lol, i didnt checked the link but i found that "Search" is value, not id. Try using If $oButton.value = "search" Then it will work.
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