abbaddon223
Registered User.
- Local time
- Today, 06:57
- Joined
- Mar 13, 2010
- Messages
- 162
Hi,
I've been banging my head with this one for about 3 days and hoping someone can help me please?
I'm using IE automation to put data from an access db into a webform, submit some values then want to get some results back. The submittin part is fine, but I can't get the values out because they are in a table! Argh!!
The VBA is below, with the table code below that:
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
Dim url As String
ie.Navigate "XXX"
While ie.Busy
DoEvents
Wend
While ie.Document.ReadyState <> "Complete"
DoEvents
Wend
ie.Document.all.Item("ctl00_subfrontend_Login1_UserName").Value = "XXX"
ie.Document.all.Item("ctl00_subfrontend_Login1_Password").Value = "XXX"
ie.Document.all.Item("ctl00$subfrontend$Login1$LoginButton").Click
While ie.Busy
DoEvents
Wend
While ie.Document.ReadyState <> "Complete"
DoEvents
Wend
ie.Document.all.Item("ctl00_lnkOIDRequest").Click
While ie.Busy
DoEvents
Wend
While ie.Document.ReadyState <> "Complete"
DoEvents
Wend
ie.Document.all.Item("ctl00$subfrontend$txtTelNumber").Value = [PhoneNumber].Value
ie.Document.all.Item("ctl00$subfrontend$txtPostcode").Value = [Postcode].Value
While ie.Busy
DoEvents
Wend
While ie.Document.ReadyState <> "Complete"
DoEvents
Wend
ie.Document.all.Item("ctl00$subfrontend$btnCommit").Click
While ie.Busy
DoEvents
Wend
While ie.Document.ReadyState <> "Complete"
DoEvents
Wend
Forms!Frm_Data_Scrape![Service].Value = ie.Document.getElementsByClassName("Service Type:").Value
The last line is the section I've tried so many variations of it's untrue! Some of the HTML code below. The elements I'm after as an example are highlighted in yellow.
Thank you to anyone who can help me please!! Phil.
</div>
<div class="subSectionLeft" style="width: 50%;">
<div class="subSection">
<h4 class="subHeader">
Line Details</h4>
<table class="detailsTable">
<tr class="TableRow">
<td class="TableCell">
Service ID:
</td>
<td class="AltTableCell">
02920665049
</td>
</tr>
<tr class="TableRow">
<td class="TableCell">
Telephone number:
</td>
<td class="AltTableCell">
029XXXX
</td>
</tr>
<tr class="TableRow">
<td class="TableCell">
Postcode:
</td>
<td class="AltTableCell">
CF1XXXX
</td>
</tr>
<tr class="TableRow">
<td class="TableCell">
Service type:
</td>
<td class="AltTableCell">
PSTN Multi Line Aux
</td>
</tr>
<tr class="TableRow">
<td class="TableCell">
Channel quantity:
</td>
<td class="AltTableCell">
3
</td>
</tr>
<tr class="TableRow">
<td class="TableCell">
Care level:
</td>
<td class="AltTableCell">
2
</td>
</tr>
I've been banging my head with this one for about 3 days and hoping someone can help me please?
I'm using IE automation to put data from an access db into a webform, submit some values then want to get some results back. The submittin part is fine, but I can't get the values out because they are in a table! Argh!!
The VBA is below, with the table code below that:
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
Dim url As String
ie.Navigate "XXX"
While ie.Busy
DoEvents
Wend
While ie.Document.ReadyState <> "Complete"
DoEvents
Wend
ie.Document.all.Item("ctl00_subfrontend_Login1_UserName").Value = "XXX"
ie.Document.all.Item("ctl00_subfrontend_Login1_Password").Value = "XXX"
ie.Document.all.Item("ctl00$subfrontend$Login1$LoginButton").Click
While ie.Busy
DoEvents
Wend
While ie.Document.ReadyState <> "Complete"
DoEvents
Wend
ie.Document.all.Item("ctl00_lnkOIDRequest").Click
While ie.Busy
DoEvents
Wend
While ie.Document.ReadyState <> "Complete"
DoEvents
Wend
ie.Document.all.Item("ctl00$subfrontend$txtTelNumber").Value = [PhoneNumber].Value
ie.Document.all.Item("ctl00$subfrontend$txtPostcode").Value = [Postcode].Value
While ie.Busy
DoEvents
Wend
While ie.Document.ReadyState <> "Complete"
DoEvents
Wend
ie.Document.all.Item("ctl00$subfrontend$btnCommit").Click
While ie.Busy
DoEvents
Wend
While ie.Document.ReadyState <> "Complete"
DoEvents
Wend
Forms!Frm_Data_Scrape![Service].Value = ie.Document.getElementsByClassName("Service Type:").Value
The last line is the section I've tried so many variations of it's untrue! Some of the HTML code below. The elements I'm after as an example are highlighted in yellow.
Thank you to anyone who can help me please!! Phil.
</div>
<div class="subSectionLeft" style="width: 50%;">
<div class="subSection">
<h4 class="subHeader">
Line Details</h4>
<table class="detailsTable">
<tr class="TableRow">
<td class="TableCell">
Service ID:
</td>
<td class="AltTableCell">
02920665049
</td>
</tr>
<tr class="TableRow">
<td class="TableCell">
Telephone number:
</td>
<td class="AltTableCell">
029XXXX
</td>
</tr>
<tr class="TableRow">
<td class="TableCell">
Postcode:
</td>
<td class="AltTableCell">
CF1XXXX
</td>
</tr>
<tr class="TableRow">
<td class="TableCell">
Service type:
</td>
<td class="AltTableCell">
PSTN Multi Line Aux
</td>
</tr>
<tr class="TableRow">
<td class="TableCell">
Channel quantity:
</td>
<td class="AltTableCell">
3
</td>
</tr>
<tr class="TableRow">
<td class="TableCell">
Care level:
</td>
<td class="AltTableCell">
2
</td>
</tr>