R
ryguy7272
I have code which goes to a internal corporate site, takes names from
ColumnZ in my spreadsheet, and pops them into a search box on a
company web site, searches, and returns, the results in another web
page. All of this works fine. Now, I’m trying to look through the TD
Elements on the search page, find something called SOEID, and import
the inner text (from that) into my spreadsheet, into ColumnAA. For
now, I’m testing to see if I can get the results into a MsgBox. If I
get that I can get the rest working. I noticed that TDelement.bgColor
= "#d9d9d9" will give me the SOEID, but there are a few
TDelement.bgColor = "#d9d9d9" in the page, so I have to drill down
another level…
Directly under TDelement.bgColor = "#d9d9d9 is <span
class="fineleft">. This too is not unique, but under this is SOEID
and this is unique! So I want to search for that combination, and
import the inner text of the SOEID.
This is how it looks in the IE Developer Tool:
<td width="15%" bgColor="#d9d9d9">
<span class="fineleft">
Text – SOEID
<td width="15%">
<span class="fineattr">
Text - GT89111
I want to import that ‘GT89111’
Set TDelements = HTMLdoc.getElementsByTagName("TD")
For Each TDelement In TDelements
If TDelement.bgColor = "#d9d9d9" And . . . < -- problem is here . . .
Then
MsgBox (TDelement.innerText)
‘sa = TDelement.innerText
‘ With Sheets("List of FAs")
‘ .Range("AA" & CStr(RowCount)).Value =
sa
‘ End With
End If
Next
RowCount = RowCount + 1
How can I reference this:
<span class="fineleft">
Or, how can I reference this:
objCell.innerText
itm.innerText
So, any ideas on how to do this? I’m sure it is possible. I’m just
at a loss now as to how to actually do it.
Thanks everyone!
ColumnZ in my spreadsheet, and pops them into a search box on a
company web site, searches, and returns, the results in another web
page. All of this works fine. Now, I’m trying to look through the TD
Elements on the search page, find something called SOEID, and import
the inner text (from that) into my spreadsheet, into ColumnAA. For
now, I’m testing to see if I can get the results into a MsgBox. If I
get that I can get the rest working. I noticed that TDelement.bgColor
= "#d9d9d9" will give me the SOEID, but there are a few
TDelement.bgColor = "#d9d9d9" in the page, so I have to drill down
another level…
Directly under TDelement.bgColor = "#d9d9d9 is <span
class="fineleft">. This too is not unique, but under this is SOEID
and this is unique! So I want to search for that combination, and
import the inner text of the SOEID.
This is how it looks in the IE Developer Tool:
<td width="15%" bgColor="#d9d9d9">
<span class="fineleft">
Text – SOEID
<td width="15%">
<span class="fineattr">
Text - GT89111
I want to import that ‘GT89111’
Set TDelements = HTMLdoc.getElementsByTagName("TD")
For Each TDelement In TDelements
If TDelement.bgColor = "#d9d9d9" And . . . < -- problem is here . . .
Then
MsgBox (TDelement.innerText)
‘sa = TDelement.innerText
‘ With Sheets("List of FAs")
‘ .Range("AA" & CStr(RowCount)).Value =
sa
‘ End With
End If
Next
RowCount = RowCount + 1
How can I reference this:
<span class="fineleft">
Or, how can I reference this:
objCell.innerText
itm.innerText
So, any ideas on how to do this? I’m sure it is possible. I’m just
at a loss now as to how to actually do it.
Thanks everyone!