superkj
08-27-2010, 08:57 AM
My code:
Sub test()
Set IeApp = New InternetExplorer
'Make it visible - some things don’t work
'unless it’s visible
IeApp.Visible = True
'Open the page
IeApp.Navigate "http://nepts.web.att.com/pts/main/pts.apsx#"
'Pause the macro using a loop until the
'page is fully loaded
Do While IeApp.Busy
Loop
Do While IeApp.ReadyState <> 4
Loop
IeApp.Document.all.Item("3.0").Click
IeApp.Document.getElementById("ddlPrimaryType").Value = "T"
IeApp.Document.getElementById("ddlLocation").Value = "IL"
IeApp.Document.getElementById("txtDescription").Value = "OPTEMAN"
IeApp.Document.getElementById("Save").Click
End Sub
I am trying to control a webpage that has sub documents or pages on it and can't seem to figure it out. When you look at the source code for the web pages there are two different source codes. There is a menu on the left side that has source code and then the page area in the middle has different source code. Whenever you select a link on the left side it goes to the correct page but always comes back with the
"http://nepts.web.att.com/pts/main/pts/apsx#" URL. For instance, when I go to IeApp.Document.all.Item("3.0").Click from the main page it takes me to a menu on the left and then the sub document. The menu on the left has the sub document URL in it (<Item id="3.0" divider="NormalDividerMiddle" title="New Uber" on="0" url="../Uber/PTSNewUber.aspx" special="0" ischild="0" visible="1"></Item>)
but I get an error on the statement:IeApp.Document.getElementById("ddlPrimaryType").Value = "T"
If I check the source of the sub document it has the info I want:
(TD style="HEIGHT: 18px" noWrap align="right">Primary Type:</TD>
<TD style="HEIGHT: 18px">
<select name="ddlPrimaryType" id="ddlPrimaryType" class="plaintext" style="width:176px;">
<option value="[Select a Primary Type]">[Select a Primary Type]</option>
<option value="M">M - Miscellaneous</option>
<option value="O">O - Outside Plant</option>
<option value="P">P - Power</option>
<option value="S">S - Switch</option>
<option value="T">T - Transport</option>
</select></TD>)
I can use sendkeys to access all the information on the website but it is very unreliable. Any help would be appreciated!!!!
Sub test()
Set IeApp = New InternetExplorer
'Make it visible - some things don’t work
'unless it’s visible
IeApp.Visible = True
'Open the page
IeApp.Navigate "http://nepts.web.att.com/pts/main/pts.apsx#"
'Pause the macro using a loop until the
'page is fully loaded
Do While IeApp.Busy
Loop
Do While IeApp.ReadyState <> 4
Loop
IeApp.Document.all.Item("3.0").Click
IeApp.Document.getElementById("ddlPrimaryType").Value = "T"
IeApp.Document.getElementById("ddlLocation").Value = "IL"
IeApp.Document.getElementById("txtDescription").Value = "OPTEMAN"
IeApp.Document.getElementById("Save").Click
End Sub
I am trying to control a webpage that has sub documents or pages on it and can't seem to figure it out. When you look at the source code for the web pages there are two different source codes. There is a menu on the left side that has source code and then the page area in the middle has different source code. Whenever you select a link on the left side it goes to the correct page but always comes back with the
"http://nepts.web.att.com/pts/main/pts/apsx#" URL. For instance, when I go to IeApp.Document.all.Item("3.0").Click from the main page it takes me to a menu on the left and then the sub document. The menu on the left has the sub document URL in it (<Item id="3.0" divider="NormalDividerMiddle" title="New Uber" on="0" url="../Uber/PTSNewUber.aspx" special="0" ischild="0" visible="1"></Item>)
but I get an error on the statement:IeApp.Document.getElementById("ddlPrimaryType").Value = "T"
If I check the source of the sub document it has the info I want:
(TD style="HEIGHT: 18px" noWrap align="right">Primary Type:</TD>
<TD style="HEIGHT: 18px">
<select name="ddlPrimaryType" id="ddlPrimaryType" class="plaintext" style="width:176px;">
<option value="[Select a Primary Type]">[Select a Primary Type]</option>
<option value="M">M - Miscellaneous</option>
<option value="O">O - Outside Plant</option>
<option value="P">P - Power</option>
<option value="S">S - Switch</option>
<option value="T">T - Transport</option>
</select></TD>)
I can use sendkeys to access all the information on the website but it is very unreliable. Any help would be appreciated!!!!