Jump to content

Help Needed w/ Basic Macro Script


Recommended Posts

;===============================================================================
;
; Function Name:    _IEBodyReadHTML()
; Description:      Returns the HTML inside the <body> tag of the document
; Parameter(s):  $o_object  - Object variable of an InternetExplorer.Application, Window or Frame object
; Requirement(s):   AutoIt3 V3.2 or higher
; Return Value(s):  On Success  - Returns HTML included in the <body> of the docuement
;                  On Failure   - Returns 0 and sets @ERROR
;                   @ERROR      - 0 ($_IEStatus_Success) = No Error
;                               - 3 ($_IEStatus_InvalidDataType) = Invalid Data Type
;                   @Extended   - Contains invalid parameter number
; Author(s):        Dale Hohm
;
;===============================================================================

I read the stuff like this before I use the function.

I have no clue what you mean by use examples.

Edited by Depression
Link to comment
Share on other sites

Okay, I learned how to get the source. But any ideas on how to get the status?

I'm thinking about using StrMid function. Heres the page source.

<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width=700 border=0>
<TBODY>
<TR>
<TD width="100%" background=tmp.gif colSpan=2 height=54>
<TABLE height=54 cellSpacing=3 width=700 border=0>
<TBODY>
<TR>
<TD colSpan=11 height=22></TD></TR>
<TR>
<TD align=middle width=175 background="" height=23>&nbsp;</TD>
<TD align=middle width=50 background="" bgColor=#a5a4a1 height=23><A href="index.htm"><FONT face=verdana color=black size=1><B>Setup</A></B></FONT></TD>
<TD align=middle width=50 background="" bgColor=#a5a4a1 height=23><A href="Passwd.htm"><FONT face=verdana color=black size=1><B>Password</A></B></FONT></TD>
<TD align=middle width=50 background="" bgColor=white height=23><A href="Status.htm"><FONT face=verdana color=#f79400 size=1><B>Status</A></B></FONT></TD>
<TD align=middle width=50 background="" bgColor=#a5a4a1 height=23><A href="DHCP.htm"><FONT face=verdana color=black size=1><B>DHCP</A></B></FONT></TD>
<TD align=middle width=50 background="" bgColor=#a5a4a1 height=23><A href="Log.htm"><FONT face=verdana color=black size=1><B>Log</A></B></FONT></TD>
<TD align=middle width=50 background="" bgColor=#a5a4a1 height=23><A href="Security.htm"><FONT face=verdana color=black size=1><B>Security</A></B></FONT></TD>
<TD align=middle width=50 background="" bgColor=#a5a4a1 height=23><A href="Help.htm"><FONT face=verdana color=black size=1><B>Help</A></B></FONT></TD>
<TD align=middle background="" height=23>&nbsp;</TD>
<TD align=middle width=50 background="" bgColor=#f79400 height=23><A href="Filters.htm"><FONT face=verdana color=black size=1><B>Advanced</A></B></FONT></TD>
<TD align=middle width=30 background="" height=23>&nbsp;</TD></TR></TBODY></TABLE>
<TR>
<TH width="23%" bgColor=black height=100><FONT face=verdana color=white size=5>STATUS</FONT></TH>
<TH vAlign=top bgColor=white>
<TABLE cellPadding=3 width="94%">
<TBODY>
<TR>
<TD><FONT face=verdana color=black size=2>This screen displays the router's current status and settings. This information is read-only.</FONT></TD></TR></TBODY></TABLE></TH></TR>
<TR>
<TH colSpan=2>
<TABLE cellSpacing=3 width="100%" bgColor=black border=1>
<TBODY>
<TR>
<TH>
<TABLE cellSpacing=0 width="100%" bgColor=white border=0>
<TBODY>
<TR>
<TH align=right width="23%" bgColor=#6666cc><FONT face=Arial color=white size=2>Host Name:&nbsp;&nbsp;</FONT></TH>
<TD>&nbsp;&nbsp;&nbsp;<FONT face=verdana size=2><B></B></FONT></TD></TR>
<TR>
<TH align=right bgColor=#6666cc><FONT face=Arial color=white size=2>Firmware Version:&nbsp;&nbsp;</FONT></TH>
<TD>&nbsp;&nbsp;&nbsp;<FONT face=verdana size=2><B>1.46.02, Aug 03 2004</B></FONT></TD></TR>
<TR>
<TH align=right bgColor=#6666cc><FONT face=Arial color=white size=2><BR>Login:&nbsp;&nbsp;</FONT></TH>
<TD><FONT face=verdana size=2><B><BR>&nbsp;&nbsp;&nbsp;PPPoE</B></FONT></TD></TR>
<TR>
<TD bgColor=#6666cc>&nbsp;</TD>
<TD><FONT face=verdana size=2><B>
<FORM action=Gozila.cgi method=get><INPUT type=hidden value=0 name=pppoeAct>&nbsp;&nbsp;&nbsp;Status: Connected</B><BR><BR>&nbsp; <INPUT onclick=pppoeAction(this.form,2) type=button value=Disconnect></FORM></FONT></TD></TR><!--LAN head-->
<TR>
<TH align=right bgColor=#6666cc><FONT face=Arial color=white size=2><BR>LAN:&nbsp;&nbsp;</FONT></TH>
<TD><BR>&nbsp;&nbsp;&nbsp;<FONT face=verdana size=1>(MAC Address: 00-04-5A-F2-F9-EE)</FONT></TD></TR>
<TR>
<TH bgColor=#6666cc>&nbsp;</TH>
<TD>
<TABLE width="90%">
<TBODY>
<TR>
<TD width="47%" bgColor=#6666cc>&nbsp; &nbsp;<FONT face=verdana color=white size=2>IP Address:</FONT></TD>
<TD><FONT face=verdana size=2>192.168.1.1</FONT></TD></TR>
<TR>
<TD bgColor=#6666cc>&nbsp; &nbsp;<FONT face=verdana color=white size=2>Subnet Mask:</FONT></TD>
<TD><FONT face=verdana size=2>255.255.255.0</FONT></TD></TR>
<TR>
<TD bgColor=#6666cc>&nbsp; &nbsp;<FONT face=verdana color=white size=2>DHCP server:</FONT></TD>
<TD><FONT face=verdana size=2>Enabled</FONT></TD></TR></TBODY></TABLE></TD></TR><!--LAN tail--><!--WAN head-->
<TR>
<TH align=right bgColor=#6666cc><FONT face=Arial color=white size=2><BR>WAN: &nbsp;</FONT></TH>
<TD><BR>&nbsp; &nbsp;<FONT face=verdana size=1>(MAC Address: 00-04-5A-F2-F9-EF)</FONT></TD></TR>
<TR>
<TH bgColor=#6666cc>&nbsp;</TH>
<TD>
<TABLE width="90%">
<TBODY>
<TR>
<TD width="47%" bgColor=#6666cc>&nbsp; &nbsp;<FONT face=verdana color=white size=2>IP Address:</FONT></TD>
<TD><FONT face=verdana size=2>71.134.237.82</FONT></TD></TR>
<TR>
<TD bgColor=#6666cc>&nbsp; &nbsp;<FONT face=verdana color=white size=2>DNS:</FONT></TD>
<TD><FONT face=verdana size=2>68.94.156.1<BR>68.94.157.1<BR>0.0.0.0</FONT></TD></TR></TBODY></TABLE></TD></TR><!--WAN tail-->
<TR>
<TH bgColor=#6666cc>&nbsp;</TH>
<TD>&nbsp;
<FORM>&nbsp; <INPUT onclick=ViewDHCP() type=button value=" DHCP Clients Table "> </FORM>
<P></P></TD></TR></TBODY></TABLE></TH></TR></TBODY></TABLE></TH></TR></TBODY></TABLE></CENTER>
Link to comment
Share on other sites

Okay, I learned how to get the source. But any ideas on how to get the status?

I'm thinking about using StrMid function. Heres the page source.

Here's the part I think you are interested in:

<FORM action=Gozila.cgi method=get><INPUT type=hidden value=0 name=pppoeAct>   Status: Connected</B><BR><BR>  <INPUT onclick=pppoeAction(this.form,2) type=button value=Disconnect></FORM>

You could just pull it with StringMid() or StringRegExp(), etc.

Using the Input tag object will require drilling down to it in the DOM, because that form is buried in a Table. If you want to go that route, you can look at the _IETagName* functions... but reading the help file doesn't seem to be your strong suit.

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Here's the part I think you are interested in:

<FORM action=Gozila.cgi method=get><INPUT type=hidden value=0 name=pppoeAct>   Status: Connected</B><BR><BR>  <INPUT onclick=pppoeAction(this.form,2) type=button value=Disconnect></FORM>

You could just pull it with StringMid() or StringRegExp(), etc.

Using the Input tag object will require drilling down to it in the DOM, because that form is buried in a Table. If you want to go that route, you can look at the _IETagName* functions... but reading the help file doesn't seem to be your strong suit.

:D

What help file?

I was thinking about stringmid() but if for some reason some html changes there could be a disaster...

Link to comment
Share on other sites

What help file?

I was thinking about stringmid() but if for some reason some html changes there could be a disaster...

What help file?!!! :D

Did you install the full version of AutoIt? And, if not, why not?

Start | Programs | AutoIt3 | AutoIt Help File

That should link you to "C:\Program Files\AutoIt3\AutoIt.chm", if you install to the default location.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I see. I got a question, there is a clipput function.

But then why is there a clipboard.au3 in the includes folder? Unless that is for more advice techniques?

In the help file, on the Contents Tab, near the bottom is a tree of UDFs. Open the list for Clipboard management and look at some of the functions.

In other words -- Read the help file.

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

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