Jump to content

vyper0

Members
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Location
    New York

vyper0's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Is there a way to get _IEAction("click") to chose the no option for my radio button when the source HTML looks like this? So far I can only get it to choose Yes. <TR class=bgwhitetext><TD class=bgwhitetext width="70%">Do you like dogs ? </TD><TD><INPUT type=radio value=Y name=AC> Yes <INPUT type=radio value=N name=AC> No </TD></TR>
  2. Try this way... CODE#include <GUIConstants.au3>; Simple example: Embedding an Internet Explorer Object inside an AutoIt GUI ; ; The full example is available in the test\ActiveX directory (TestXInternet.au3) ; ; See also: http://msdn.microsoft.com/workshop/browser...netexplorer.asp $oIE = ObjCreate("Shell.Explorer.2") ; Create a simple GUI for our output GUICreate ( "BOBCO Embedded Web Broswer", 1024, 768,(@DesktopWidth-1024)/2, (@DesktopHeight-768)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj ( $oIE, 0 , 0 , 1024 , 768 ) GUISetState () ;Show GUI $oIE.navigate("http://www.google.com") ;Waiting for user to close the window While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect Wend GUIDelete () Exit
  3. I used the following (along with Debug bar) to find all of the forms on the page. <div class='codetop'>CODE</div><div class='codemain' style='height:200px;overflow:auto'>#include <IE.au3> $oIE = _IECreate ("D:\Desktop\testpages\webform.asp.htm") $oForms = _IEFormGetCollection ($oIE) $iNumForms = @extended MsgBox(0, "Forms Info", "There are " & $iNumForms & " forms on this page") For $i = 0 to $iNumForms - 1 $oForm = _IEFormGetCollection ($oIE, $i) MsgBox(0, "Form Info", $oForm.name) Next</div> and the is only one form and this is all that the form consists of... <div class='codetop'>CODE</div><div class='codemain' style='height:200px;overflow:auto'><FORM method=post name=wb.asp autocomplete="off"></FORM></div>
  4. I do use the DebugBar. That's how I was able to get past the first two webpages. The first page is a login and the second I need to click a link to get to the questions that I am having trouble with. The first two pages I was able to get the form name. I'm pretty sure that the radio buttons on the third page are not part of a form and that's where I'm stuck. Here is the code I'm using for the first two pages that I need to navigate through. <div class='codetop'>CODE</div><div class='codemain' style='height:200px;overflow:auto'> #include <IE.au3> $oIE =_IECreate("http://google.com") ; waits for page to load before proceeding...i think _IELoadWait ($oIE) ; get pointers to the login form and username, password and signin fields $o_form = _IEFormGetObjByName($oIE,"form1") $o_login = _IEFormElementGetObjByName($o_form,"USER_ID") $o_password = _IEFormElementGetObjByName($o_form,"USER_PASSWORD") $o_signin = _IEFormElementGetObjByName($o_form,"LOGIN") ;fill out form _IEFormElementSetValue ($o_login, "$$$ID$$$") _IEFormElementSetValue ($o_password, "$$$PASS$$$") ;click login button ;_IEAction ($o_signin, "click") _IEFormImageClick ($o_form, "Login", "alt") _IELoadWait ($oIE) ;clicks link on second page to enter webcert _IELinkClickByText ($oIE, "Identifiable text to click on") _IELoadWait ($oIE) ;clicks continue on webform welcome page _IEFormImageClick ($oIE, "CONTINUE", "alt")</div> Here is what I'm working on now to get through the third page. As you can see by the commented out lines, I have tried several ways... <div class='codetop'>CODE</div><div class='codemain' style='height:200px;overflow:auto'> #include <IE.au3> $oIE =_IECreate("D:\Desktop\testpages\webform.asp.htm") ;_IELoadWait ($oIE) $oForms = _IEFormGetCollection ($oIE, 0) ; $oForm = _IEGetObjByName ($oIE, "AC") ; ;$oForm = _IEFormGetCollection ($oIE, 0) _IEFormElementRadioSelect ($oForm, "AC", 1) MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page") For $oForm In $oForms MsgBox(0, "Form Info", $oForm.name) Next $oElement1 =_IEGetObjByName ($oIE, "A1") _IEAction($oElement1, "click") $oElement2 =_IEGetObjByName ($oIE, "A2") _IEAction($oElement2, "click") ; $oElement3 =_IEGetObjByName ($oIE, "A3") ; this doesnt work because Yes is selected and I need to choose No. ; _IEAction($oElement3, "click") ; $oElement4 =_IEGetObjByName ($oIE, "AC") ; this doesnt work because Yes is selected and I need to choose No. ; _IEAction($oElement4, "click") ; $oElement5 =_IEGetObjByName ($oIE, "CONTINUE"); this does work but I cannot choose continue until I complete all questions. ; _IEAction($oElement5, "click")</div>
  5. So I've tried a number of ways to click the No radio button on my webpage but I cannot figure out how to reference the radio button. I looked through the HTML of the page (which is in my post above) and I don't think the radio buttons are on a form and if it I cannot find the form name/ID.
  6. I am trying to answer a series of questions on a webpage. There are 4 questions each with its own name (A1, A2, A3 and AC). As shown below... <div class='codetop'>CODE</div><div class='codemain' style='height:200px;overflow:auto'> <TR class=bgwhitetext><TD class=bgwhitetext width="70%">1. Do you like apples? </TD> <TD width="20%"><INPUT type=radio CHECKED value=Y name=A1> Yes <INPUT type=radio value=N name=A1> No </TD></TR> <TR class=bgwhitetext><TD class=bgwhitetext width="70%">1. Do you like oranges? </TD> <TD width="20%"><INPUT type=radio CHECKED value=Y name=A2> Yes <INPUT type=radio value=N name=A2> No </TD></TR> <TR class=bgwhitetext><TD class=bgwhitetext width="70%">1. Do you like kiwi? </TD> <TD width="20%"><INPUT type=radio CHECKED value=Y name=A1> Yes <INPUT type=radio value=N name=A1> No </TD></TR> <TR class=bgwhitetext><TD class=bgwhitetext width="70%">Do you like dogs ? </TD><TD><INPUT type=radio value=Y name=AC> Yes <INPUT type=radio value=N name=AC> No </TD></TR> <INPUT onclick="return validateinput(document.forms[0]);" tabIndex=3 type=image alt=CONTINUE src="webcert_filing.asp_files/button_continue.gif" align=right border=0 name=CONTINUE> </div> These questions are not a part of a form so I haven't been able to use _IEFormElementRadioSelect. Questions A1 and A2 will be answered as Yes so I am able to use the following for these 2 : <div class='codetop'>CODE</div><div class='codemain' style='height:200px;overflow:auto'> $oElement1 =_IEGetObjByName ($oIE, "A1") _IEAction($oElement1, "click") $oElement2 =_IEGetObjByName ($oIE, "A2") ;Need to answer No to A3 ;Need to answer No to AC _IEAction($oElement2, "click") $oElement5 =_IEGetObjByName ($oIE, "CONTINUE") _IEAction($oElement5, "click") </div> I have been struggling to find a way to click No for the other two questions.
  7. I thought I had it figured out but when the script executes the submit button, the credentials are not passed thru. the webpage is www.bestrussiantv.com neither the login form or the password box have names so i get them by index reference. CODE#include <IE.au3> $oIE =_IECreate("http://www.bestrussiantv.com") $o_form = _IEFormGetCollection ($oIE, 0) $o_login = _IEFormElementGetObjByName($o_form,"login") _IEFormElementSetValue ($o_login, "USERIDGOESHERE") $o_password = _IEFormElementGetCollection ($o_form, 1) _IEFormElementSetValue ($o_password, "PASSWORDGOESHERE") _IEFormImageClick ( $oIE, "images/button_login.gif") any ideas?
×
×
  • Create New...