Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Webrowser Control - Qs - get tag properties etc

Posted on 2004-04-14
3
Medium Priority
?
313 Views
Last Modified: 2010-04-17
q1 - I need to get the value of a table cell [I think it has no specific id or name]

q2 - I'm trying to list off the properties of the td tags but don't know any other properties to check [other than tagname and id], is there a WWW reference to all the objects and their respect properties for Webrowser1.Document...???

For Each iItem In WebBrowser1.Document.All.tags("td")
 Debug.Print iItem.tagname, iItem.Id
Next

- I figure there is a constant heading "Amount" in one cell, so if I get the ?text/value? from the next cell, I will be golden.



0
Comment
Question by:williamsF1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
someman4oneman earned 240 total points
ID: 10829208
Welcome to the land of DOM traversal.....
Here is some code that I ran in VB script which should give you an idea of
what you need to do.
'*******************************************************
'Get your list
Dim NodeList
Set NodeList = Document.getElementsByTagName("td")

'I am iterating with count instead of your collection
'because I use the count  to get the next node once I have got the amount node
For iItem = 0 To NodeList.Length - 1

            'The text in a td is a node so I get the
                'the child node of the TD and see if it equals "Amount"
            If NodeList(iItem).childNodes(0).nodeValue = "Amount" Then
                        'If it does equal amount then get the text of the next td node
                  MsgBox(NodeList(iItem + 1).childNodes(0).nodeValue)
            End If
Next
'*******************************************************

My test doc is

<html>
      <body>
            <table>
                  <tr>
                        <td>invalid</td>
                        <td>Amount</td>
                        <td>1000</td>
                  </tr>
                  <tr>
                        <td>Amount</td>
                        <td>1000</td>
                                <td>invalid</td>
                  </tr>
            </table>
      </body>
</html>

It may seem convoluted but  think the idea is to have a standard mechanism across all languages
for accessing XML.(thats Standards for ya) If I was to do the same thing in Java my code would look very similar.

0
 

Author Comment

by:williamsF1
ID: 10836150
I think I got this to work, but one last thing, how would I get the href value from

<TD align=right width="50%">
<A class=Blue href="https://192.168.0.10/preparer_1.asp">
Clickhere
</A>
</TD>
0
 

Assisted Solution

by:fungord
fungord earned 80 total points
ID: 10853399

For Each iItem In WebBrowser1.Document.Links
 if iItem.innertext = "Clickhere" then
    Debug.Print iItem.tagname, iItem.innertext, iItem.href
    Exitfor
 endif
Next

To find out move info on the object, while debugging you could 'add a watch' to iItem.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Starting up a Project

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question