Results 1 to 10 of 10

Thread: Parse HTML Text into a TextBox

  1. #1

    Thread Starter
    Banned
    Join Date
    Jul 2006
    Location
    Atlanta, GA, USA
    Posts
    28

    Question Parse HTML Text into a TextBox

    Ok. I want to connect to tvguide.com and get show information about a show that the user inputs. I want everything to stay in my application and not open up other programs, IE or FF etc. However, I don't know where to start. Thanks for your help in advance!

  2. #2
    New Member
    Join Date
    May 2006
    Posts
    9

    Re: Parse HTML Text into a TextBox

    you coulde use the webbrowser control to do this.

  3. #3
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: Parse HTML Text into a TextBox

    Quote Originally Posted by TH3 K1D
    Ok. I want to connect to tvguide.com and get show information about a show that the user inputs. I want everything to stay in my application and not open up other programs, IE or FF etc. However, I don't know where to start. Thanks for your help in advance!

    there are many ways to get the data of the website(winsock, net.sockets, inet, etc). the getting data inbetween tags is wat im not sure about.


    if u do use a webbrowser control simple do this.


    webbrowser1.navigate("http://site.com")

    and under the webbrowser navigation complete or document complete put

    dim website as string = webbrowser1.document

    and that will get all the html data.

  4. #4

    Thread Starter
    Banned
    Join Date
    Jul 2006
    Location
    Atlanta, GA, USA
    Posts
    28

    Re: Parse HTML Text into a TextBox

    Ok, thank you both.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Parse HTML Text into a TextBox

    You would use an HttpWebRequest object to make a request to a Web server. You wouldn't use a WebBrowser control unless you wanted to display the rendered page to the user.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: Parse HTML Text into a TextBox

    Quote Originally Posted by jmcilhinney
    You would use an HttpWebRequest object to make a request to a Web server. You wouldn't use a WebBrowser control unless you wanted to display the rendered page to the user.

    accually webbrowser controls can be used for more then just displaying.

  7. #7

    Thread Starter
    Banned
    Join Date
    Jul 2006
    Location
    Atlanta, GA, USA
    Posts
    28

    Re: Parse HTML Text into a TextBox

    VB Code:
    1. WebBrowser1.Visible = False

    You can hide it. I don't think I'm going to continue working on this project (at the time).

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Parse HTML Text into a TextBox

    Of course you can create a WebBrowser control and hide it, but you could also buy a house when you need a door knob. The HttpWebRequest class exists specifically for making requests to an HTTP server. If that's what you want to do, why would you use something with all the overhead of a WebBrowser control? Controls exist to provide visual feedback to the user. If no visual feedback is required then controls should be avoided if at all possible.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  9. #9

    Thread Starter
    Banned
    Join Date
    Jul 2006
    Location
    Atlanta, GA, USA
    Posts
    28

    Re: Parse HTML Text into a TextBox

    I know, I was just saying you could hide it. If I were to continue this application I would deffinatly use the HttpWebRequest. I read about it on the MSDN link you posted. It seems like it can very easily do what I need it to do.

  10. #10
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: Parse HTML Text into a TextBox

    Quote Originally Posted by jmcilhinney
    Of course you can create a WebBrowser control and hide it, but you could also buy a house when you need a door knob. The HttpWebRequest class exists specifically for making requests to an HTTP server. If that's what you want to do, why would you use something with all the overhead of a WebBrowser control? Controls exist to provide visual feedback to the user. If no visual feedback is required then controls should be avoided if at all possible.

    u can always just declare it instead so it doesnt use up the form control memory.

    also webbrowser is just a quicker way. and i never said he had to do it.

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