dcsimg
Results 1 to 6 of 6

Thread: webbrowser inner html

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    312

    Smile webbrowser inner html

    Hey all, i have a timer, the timer is grabbing the inner html of a webbrowser1 on a form called log and putting it into textbox2 on the current form.

    code being used

    PHP Code:
      Dim webbrowser1 As New WebBrowser

            textbox2
    .Text = (log.WebBrowser1.Document.Body.InnerHtml
    but i have a problom where the 1st time the timmer dose it, everything gets added as it should, but the second time its not giving new text. e.g. the inner html has changed but textbox2.text = the inner html of the 1st exstract.

    Anyone know what might be going wrong, or no a way to fix it?

    Thanks

    Paul
    Please Rate If I helped you.
    Please remember to mark threads as closed if your issue has been resolved.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,383

    Re: webbrowser inner html

    how is the text changing? are you navigating to the page again? is it updated via AJAX?

    The code you posted is obviously not complete, you didn't specify how you are navigating around to the URL, or when you are doing the scraping, your timer interval, etc..

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    312

    Re: webbrowser inner html

    the text is changing by navigating the webpage ( to the same page ) where text on the page gets updated.

    The timer interval is set to 30 seconds

    the timer starts on the webbrowser navigated
    Last edited by Paul_so40; Sep 11th, 2009 at 11:21 AM.
    Please Rate If I helped you.
    Please remember to mark threads as closed if your issue has been resolved.

  4. #4
    Addicted Member ZenDisaster's Avatar
    Join Date
    Dec 2006
    Location
    Bay Area, CA
    Posts
    140

    Re: webbrowser inner html

    You may want to check out the WebBrowser's DocumentComplete event to grab that data. This way whenever a page is loaded your code is ran once, and only once, exactly when it is needed.

    I'm assuming you named a form "log" and that your webbrowser control is on it and this code resides within a different form?

    You should be able to call a property of the WebBrowser control directly and not need to create an instance of it.

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,383

    Re: webbrowser inner html

    Quote Originally Posted by ZenDisaster View Post
    You may want to check out the WebBrowser's DocumentComplete event to grab that data. This way whenever a page is loaded your code is ran once, and only once, exactly when it is needed.

    I'm assuming you named a form "log" and that your webbrowser control is on it and this code resides within a different form?

    You should be able to call a property of the WebBrowser control directly and not need to create an instance of it.
    DocumentCompleted only fires once in non frames situations. Any pages with frames (or iframes I believe) will fire it multiple times.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    312

    Re: webbrowser inner html

    Quote Originally Posted by ZenDisaster View Post
    You may want to check out the WebBrowser's DocumentComplete event to grab that data. This way whenever a page is loaded your code is ran once, and only once, exactly when it is needed.

    I'm assuming you named a form "log" and that your webbrowser control is on it and this code resides within a different form?

    You should be able to call a property of the WebBrowser control directly and not need to create an instance of it.

    Thanks, ill have a muck around with the doccument complete then, and ill get back to you
    Please Rate If I helped you.
    Please remember to mark threads as closed if your issue has been resolved.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width