Jump to content

Recommended Posts

Posted (edited)

Welcome all

In previous post I asked for Code to get Text from Menu and a there is a lot of good members who helped me to do this .

And now I want to know If there is any way to chose some Value from menu or not  This is the Menu Source:

<TR>
<TD CLASS="dddefault">
<SELECT NAME="selected_day">
<OPTION VALUE="14-OCT-16">14-OCT-16
<OPTION VALUE="13-OCT-16">13-OCT-16
<OPTION VALUE="12-OCT-16">12-OCT-16
<OPTION VALUE="11-OCT-16">11-OCT-16
<OPTION VALUE="10-OCT-16">10-OCT-16
</SELECT>
</TR>

I want some way to  make 14-OCT-16 or 13-OCT-16... Chosen

I Found this :

But I don't know how to use it with my code..

Solved :

Thanks All For Your efforts and sorry if i Taken from your time

Edited by abdulrahmanok
Posted

 This also Didn't work !

$MsgForm = _IEFormGetCollection ("https://mybanner.qu.edu.qa/PROD/bwsksest.p_select_day",0)
$MsgCountry = _IEFormElementGetObjByName ($MsgForm, "selected_day")
$value = _IEFormElementGetValue ($MsgCountry)
_IEFormElementOptionselect ($MsgCountry, "30-OCT-16", 1, "ByValue")

 

Posted

Full page Source :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/transitional.dtd">
<HTML lang="en">
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="Pragma" NAME="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" NAME="Cache-Control" CONTENT="no-cache">
<LINK REL="stylesheet" HREF="/css/web_defaultapp.css" TYPE="text/css">
<LINK REL="stylesheet" HREF="/css/web_defaultprint.css" TYPE="text/css" media="print">
<TITLE>Student Employment Time Attendance</TITLE>
<META HTTP-EQUIV="Content-Script-Type" NAME="Default_Script_Language" CONTENT="text/javascript">
<SCRIPT type="text/javascript" src="https://ff.kis.v2.scr.kaspersky-labs.com/C61E6CFC-A76B-B94B-8A26-DE905AA5D6D2/main.js" charset="UTF-8"></script><script LANGUAGE="JavaScript" TYPE="text/javascript">
<!-- Hide JavaScript from older browsers 
var submitcount=0;
function checkSubmit() {
if (submitcount == 0)
   {
   submitcount++;
   return true;
   }
else
   {
alert("Your changes have already been submitted.");
   return false;
   }
}
//  End script hiding -->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!-- Hide JavaScript from older browsers 
//  Function to open a window
function windowOpen(window_url) {
   helpWin = window.open(window_url,'','toolbar=yes,status=no,scrollbars=yes,menubar=yes,resizable=yes,directories=no,location=no,width=350,height=400');
   if (document.images) { 
       if (helpWin) helpWin.focus()
   }
}
//  End script hiding -->
</SCRIPT>
</HEAD>
<BODY>
<DIV class="headerwrapperdiv">
<DIV class="pageheaderdiv1">
<A HREF="#main_content" onMouseover="window.status='Go to Main Content'; return true" onMouseout="window.status=''; return true" OnFocus="window.status='Go to Main Content'; return true" onBlur="window.status=''; return true" class="skiplinks">Go to Main Content</A>
<H1>myQU Self Service</H1></DIV><DIV class="headerlinksdiv">
<SPAN class="pageheaderlinks2">
<MAP NAME="Module_Navigation_Links_H" title="Module Navigation Links">
<p>
<A HREF="#skip_Module_Navigation_Links_H" onMouseover="window.status='Skip Module Navigation Links'; return true" onMouseout="window.status=''; return true" onFocus="window.status='Skip Module Navigation Links'; return true" onBlur="window.status=''; return true"  class="skiplinks">Skip Module Navigation Links</A>
<TABLE  CLASS="plaintable" SUMMARY="This is main table for displaying Tab Items."
                          WIDTH="100%" cellSpacing=0 cellPadding=0 border=0>
<TR>
<TD CLASS="pldefault">
<TABLE  CLASS="plaintable" SUMMARY="This table displays Tab Items."
                 cellSpacing=0 cellPadding=0 border=0>
<TR>
<td class="taboff" height=22>
<A HREF="/PROD/twbkwbis.P_GenMenu?name=bmenu.P_GenMnu" onMouseover="window.status='Personal Information'; return true" onMouseout="window.status=''; return true" onFocus="window.status='Personal Information'; return true" onBlur="window.status=''; return true" >Personal Information</A>
</TD>
<TD class="bgtaboff" height=22 vAlign="top" align="right">
<IMG SRC="/wtlgifs/web_tab_corner_right.gif" ALT="Tab Corner Right" CLASS="headerImg" TITLE="Tab Corner Right"  NAME="web_tab_corner_right" HSPACE=0 VSPACE=0 BORDER=0 HEIGHT=20 WIDTH=8>
</TD>
<td class="taboff" height=22>
<A HREF="/PROD/twbkwbis.P_GenMenu?name=bmenu.P_StuMainMnu" onMouseover="window.status='Student Registrations and Records'; return true" onMouseout="window.status=''; return true" onFocus="window.status='Student Registrations and Records'; return true" onBlur="window.status=''; return true" >Student Registrations and Records</A>
</TD>
<TD class="bgtaboff" height=22 vAlign="top" align="right">
<IMG SRC="/wtlgifs/web_tab_corner_right.gif" ALT="Tab Corner Right" CLASS="headerImg" TITLE="Tab Corner Right"  NAME="web_tab_corner_right" HSPACE=0 VSPACE=0 BORDER=0 HEIGHT=20 WIDTH=8>
</TD>
<td class="tabon"  height=22>
<A HREF="/PROD/twbkwbis.P_GenMenu?name=bmenu.P_SSMnu" onMouseover="window.status='Student Services'; return true" onMouseout="window.status=''; return true" onFocus="window.status='Student Services'; return true" onBlur="window.status=''; return true" >Student Services</A>
</TD>
<TD class="bgtabon"  height=22 vAlign="top" align="right">
<IMG SRC="/wtlgifs/web_tab_corner_right.gif" ALT="Tab Corner Right" CLASS="headerImg" TITLE="Tab Corner Right"  NAME="web_tab_corner_right" HSPACE=0 VSPACE=0 BORDER=0 HEIGHT=20 WIDTH=8>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD class="bgtabon" width="100%" colSpan=2><IMG SRC="/wtlgifs/web_transparent.gif" ALT="Transparent Image" CLASS="headerImg" TITLE="Transparent Image"  NAME="web_transparent" HSPACE=0 VSPACE=0 BORDER=0 HEIGHT=3 WIDTH=10></TD></TR></TABLE>
</MAP>
</SPAN>
<a name="skip_Module_Navigation_Links_H"></a>
</DIV>
<TABLE  CLASS="plaintable" SUMMARY="This table displays Menu Items and Banner Search textbox."
         WIDTH="100%">
<TR>
<TD CLASS="pldefault">
<DIV class="headerlinksdiv2">
<FORM ACTION="/PROD/twbksrch.P_ShowResults" METHOD="POST">
Search
<SPAN class="fieldlabeltextinvisible"><LABEL for=keyword_in_id><SPAN class="fieldlabeltext">Search</SPAN></LABEL></SPAN>
<INPUT TYPE="text" NAME="KEYWRD_IN" SIZE="20" MAXLENGTH="65" ID="keyword_in_id">
<INPUT TYPE="submit" VALUE="Go">
</FORM>
</div>
</TD>
<TD CLASS="pldefault"><p class="rightaligntext"></p>
<SPAN class="pageheaderlinks">
<A HREF="/PROD/twbksite.P_DispSiteMap?menu_name_in=bmenu.P_MainMnu&amp;depth_in=2&amp;columns_in=3" accesskey="2" class="submenulinktext2">SITE MAP</A>
|
<A HREF="/wtlhelp/twbhhelp.htm" accesskey="H" onClick="popup = window.open('/wtlhelp/twbhhelp.htm', 'PopupPage','height=500,width=450,scrollbars=yes,resizable=yes'); return false" target="_blank" onMouseOver="window.status='';  return true" onMouseOut="window.status=''; return true"onFocus="window.status='';  return true" onBlur="window.status=''; return true"  class="submenulinktext2">HELP</A>
|
<A HREF="twbkwbis.P_Logout" accesskey="3" class="submenulinktext2">EXIT</A>
</span>
</TD>
</TR>
</TABLE>
</DIV>
<DIV class="pagetitlediv">
<TABLE  CLASS="plaintable" SUMMARY="This table displays title and static header displays."
   WIDTH="100%">
<TR>
<TD CLASS="pldefault">
<H2>Student Employment Time Attendance</H2>
</TD>
<TD CLASS="pldefault">
&nbsp;
</TD>
<TD CLASS="pldefault"><p class="rightaligntext"></p>
<DIV class="staticheaders">
201306497 Abdelrahman H. Hussein<br>
Nov 02, 2016 10:12 pm<br>
</div>
</TD>
</TR>
<TR>
<TD class="bg3" width="100%" colSpan=3><IMG SRC="/wtlgifs/web_transparent.gif" ALT="Transparent Image" CLASS="headerImg" TITLE="Transparent Image"  NAME="web_transparent" HSPACE=0 VSPACE=0 BORDER=0 HEIGHT=3 WIDTH=10></TD>
</TR>
</TABLE>
<a name="main_content"></a>
</DIV>
<DIV class="pagebodydiv">
<!--  ** END OF twbkwbis.P_OpenDoc **  -->

<FORM ACTION="/PROD/bwsksest.p_apply" METHOD="POST">
<TABLE  CLASS="datadisplaytable" SUMMARY="This table lists the days for the student." WIDTH = "100%"><CAPTION class="captiontext">Please select a day:</CAPTION>
<TR>
<TD CLASS="dddefault">&nbsp;</TD>
</TR>
<TR>
<TD CLASS="dddefault">
<SELECT NAME="selected_day">
<OPTION VALUE="02-NOV-16">02-NOV-16
<OPTION VALUE="01-NOV-16">01-NOV-16
<OPTION VALUE="31-OCT-16">31-OCT-16
<OPTION VALUE="30-OCT-16">30-OCT-16
<OPTION VALUE="29-OCT-16">29-OCT-16
</SELECT>
</TR>
</TABLE>
<P class="whitespace2">
<INPUT TYPE="hidden" NAME="appl_no" VALUE="4">
<INPUT TYPE="submit" VALUE=" Next">
</FORM>
<A HREF="javascript:history.go(-1)" onMouseOver="window.status='Return to Previous';  return true" onFocus="window.status='Return to Previous';  return true" onMouseOut="window.status='';  return true"onBlur="window.status='';  return true">Return to Previous</A>

<!--  ** START OF twbkwbis.P_CloseDoc **  -->
<TABLE  CLASS="plaintable" SUMMARY="This is table displays line separator at end of the page."
                                             WIDTH="100%" cellSpacing=0 cellPadding=0 border=0><TR><TD class="bgtabon" width="100%" colSpan=2><IMG SRC="/wtlgifs/web_transparent.gif" ALT="Transparent Image" CLASS="headerImg" TITLE="Transparent Image"  NAME="web_transparent" HSPACE=0 VSPACE=0 BORDER=0 HEIGHT=3 WIDTH=10></TD></TR></TABLE>
<A HREF="#top" onMouseover="window.status='Skip to top of page'; return true" onMouseout="window.status=''; return true" OnFocus="window.status='Skip to top of page'; return true" onBlur="window.status=''; return true" class="skiplinks">Skip to top of page</A>
</DIV>
<DIV class="footerbeforediv">

</DIV>
<DIV class="footerafterdiv">

</DIV>
<DIV class="globalafterdiv">

</DIV>
<DIV class="globalfooterdiv">

</DIV>
<DIV class="pagefooterdiv">
<SPAN class="releasetext">Release: 7.3.3</SPAN>
</DIV>
<DIV class="poweredbydiv">
</DIV>
<DIV class="div1"></DIV>
<DIV class="div2"></DIV>
<DIV class="div3"></DIV>
<DIV class="div4"></DIV>
<DIV class="div5"></DIV>
<DIV class="div6"></DIV>
</BODY>
</HTML>

 

Posted
  On 11/2/2016 at 7:11 PM, abdulrahmanok said:

It doesn't show any error

Expand  

Please read:
 How to use IE.au3  UDF with  AutoIt v3.3.14.x  

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

@mLipok

Your post is to click in button I don't know how to use it here ..

  On 11/2/2016 at 8:37 PM, Danp2 said:

This is an invalid command. The first parameter is wrong. Look at the help file for proper use of _IEFormGetCollection.

Expand  

I know its wrong but I wrote it like this because I don't have "Form name" in the Site

Posted

No..
My post is about how to use _IE functions at all.
Focus on:

; STEP 1
; YOU MUST SET ANY COM ERROR HANDLER IN ONE OF THE FOLLOWING WAY

; STEP 1: CASE 1
; you should set COM Error Handler Function for ie.au3 UDF
_IEErrorHandlerRegister(_User_ErrFunc)

; STEP 1: CASE 2
; eventually if you not want to recieve additional information
; you can use just the same function without parameter
; _IEErrorHandlerRegister()

; STEP 1: CASE 3
; or use your own global COM Error Handler
;~ Global $oCOMErrorHandler = ObjEvent("AutoIt.Error", _User_ErrFunc)

; STEP 2
; if you do not wish to get in Console Output Pane information like the following:
;           --> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType
;   You can uncomment this following line:
;       _IEErrorNotify(False)

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 11/3/2016 at 4:50 AM, abdulrahmanok said:

I know its wrong but I wrote it like this because I don't have "Form name" in the Site

Expand  

If you know the code is wrong, then you shouldn't post it and state "This also Didn't work !"

Telling us that something doesn't work is useless without additional details to back up your statement.

  Quote
$MsgForm = _IEFormGetCollection ("https://mybanner.qu.edu.qa/PROD/bwsksest.p_select_day",0)
Expand  

As I stated before, this is an invalid command related to the first parameter. It has nothing to do with not knowing the for name. Assuming that your IE object is contained in the $oIE variable, you would want to write it like this:

$MsgForm = _IEFormGetCollection ($oIE,0)

See the difference? If not, read the help file until you do.

Posted
  On 11/3/2016 at 8:33 AM, mLipok said:

No..
My post is about how to use _IE functions at all.
Focus on:

; STEP 1
; YOU MUST SET ANY COM ERROR HANDLER IN ONE OF THE FOLLOWING WAY

; STEP 1: CASE 1
; you should set COM Error Handler Function for ie.au3 UDF
_IEErrorHandlerRegister(_User_ErrFunc)

; STEP 1: CASE 2
; eventually if you not want to recieve additional information
; you can use just the same function without parameter
; _IEErrorHandlerRegister()

; STEP 1: CASE 3
; or use your own global COM Error Handler
;~ Global $oCOMErrorHandler = ObjEvent("AutoIt.Error", _User_ErrFunc)

; STEP 2
; if you do not wish to get in Console Output Pane information like the following:
;           --> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType
;   You can uncomment this following line:
;       _IEErrorNotify(False)
Expand  

If you mean like This :

Local $oIE = _IECreate("https://mybanner.qu.edu.qa/PROD/bwsksest.p_select_day")
    _IELoadWait($oIE)
    Local $sTitle = '[REGEXPTITLE:(?i)(.*mybanner.qu.edu.qa.*Internet Explorer.*)]'
    Local $oIE_Test = _IEAttachToTitle($sTitle)

Local $oForm = _IEFormGetObjByName($oIE_Test, 0)
Local $oSelect = _IEFormElementGetObjByName($oForm, "selected_day")
    _IEFormElementOptionSelect($oSelect, "30-OCT-16", 1, "byText")
        ToolTip("", 0, 0)


Didn't work also :(

 

Posted
  On 11/3/2016 at 12:59 PM, Danp2 said:

If you know the code is wrong, then you shouldn't post it and state "This also Didn't work !"

Telling us that something doesn't work is useless without additional details to back up your statement.

As I stated before, this is an invalid command related to the first parameter. It has nothing to do with not knowing the for name. Assuming that your IE object is contained in the $oIE variable, you would want to write it like this:

$MsgForm = _IEFormGetCollection ($oIE,0)

See the difference? If not, read the help file until you do.

Expand  

Firstly Welcome back again in post,

Sorry because I make you think like this , What I want to say Is that I tried before This :

Local $oIE = _IECreate("https://mybanner.qu.edu.qa/PROD/bwsksest.p_select_day")    
$MsgForm = _IEFormGetCollection ($oIE,0)
$MsgCountry = _IEFormElementGetObjByName ($MsgForm, "selected_day")
$value = _IEFormElementGetValue ($MsgCountry)
_IEFormElementOptionselect ($MsgCountry, "30-OCT-16", 1, "ByValue")

And I doesn't work Also So I posted Code above..

 

 

Posted
  On 11/3/2016 at 1:11 PM, abdulrahmanok said:

Firstly Welcome back again in post,

Sorry because I make you think like this , What I want to say Is that I tried before This :

Local $oIE = _IECreate("https://mybanner.qu.edu.qa/PROD/bwsksest.p_select_day")    
$MsgForm = _IEFormGetCollection ($oIE,0)
$MsgCountry = _IEFormElementGetObjByName ($MsgForm, "selected_day")
$value = _IEFormElementGetValue ($MsgCountry)
_IEFormElementOptionselect ($MsgCountry, "30-OCT-16", 1, "ByValue")

And I doesn't work Also So I posted Code above..

Expand  

"Doesn't work" isn't an adequate description of why it is failing. Run the code in Scite and post the results from the output window.

Posted

Finally found Solution from old post

Worked Code :

Local $oIE = _IECreate("https://mybanner.qu.edu.qa/PROD/bwsksest.p_select_day")    
$oSelect = _IEGetObjByName($oIE, "selected_day")
    _IEFormElementOptionSelect($oSelect, "01-NOV-16", 1, "byText")

 

My Life Saved in 3 Lines Only :D

Posted

Important notice :

Thank you all because you trying to learning me not just give me final code , but I prefers learning by Example

that's why i loved this language (autoit) For Example : I learnt from final code in this post how to get Some Obj From IE by Name ...

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...