Results 1 to 3 of 3

Thread: Getting elements from a webbrowser

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2013
    Posts
    32

    Getting elements from a webbrowser

    Hey guys,

    Hoping someone can help me out here.

    I'm trying to pull a few bits of info from a web page programatically.

    The HTML in question is like this...

    <body>
    <!-- body content -->
    <div id="content">
    <!-- Page Header -->
    <h1>
    PRODUCTNAME
    </h1>


    <!-- End Page Header -->
    <div id="productImg">
    <img id="product.image.large.015" alt="PRODUCTNAME™" src="PRODUCTIMAGEURL" border="0" />
    </div>
    <div id="productAlt">
    <table width="98%" border="0" cellspacing="1" cellpadding="2">
    <tr class="altRowLtGray">
    <td>
    Item #
    <span style="text-decoration: inherit;">015</span>

    </td>
    </tr>
    <tr class="altRowLtGray">
    <td>
    <span style="float: left;">PRODUCTPRICE GBP</span>
    <span style="float: right; padding-left: 1em;"></span>
    </td>
    </tr>
    <tr class="altRowLtGray">
    <td>
    PRODUCTADDITIONALINFO
    </td>
    </tr>
    </table>
    </body>
    I need to retrieve the 4 items marked in bold (PRODUCTNAME appears in a few places) but am struggling as any examples I find dont seem to be able to be transposed to suit the above HTML.

    I know I need to use either GetElementByID or GetElementByTagName, but i've not used either of these functions before so please forgive my ignorance.

    Any help appriciated!!!

  2. #2
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,390

    Re: Getting elements from a webbrowser

    Is there a reason you need the webbrowser control over other classes that dont need to render UI elements.

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2013
    Posts
    32

    Re: Getting elements from a webbrowser

    not at all... I actually hide the browser behind a panel, so if i can do this without rendering the page, that would be epic

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width