CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010
    Posts
    24

    source code from WebBrowser Control: Possible?

    is it possible to retrieve a page's source code after using:
    Code:
    browser.Navigate(new Uri(URL));
    if so, Examples would be GREATLY appreciated... Thanks

  2. #2
    Join Date
    Nov 2010
    Posts
    5

    Re: source code from WebBrowser Control: Possible?

    http://en.csharp-online.net/Configur...rowser_Control

    Couldn't you just use the document property to get a htmldocument object of the current webpage and convert that to a string? If you are just looking to display the source code this should work.
    Last edited by jackorocko; November 4th, 2010 at 05:58 PM.

  3. #3
    Join Date
    Apr 2004
    Location
    England, Europe
    Posts
    2,492

    Re: source code from WebBrowser Control: Possible?

    Would WebBrowser.DocumentText not do the trick?

    http://msdn.microsoft.com/en-us/libr...=VS.80%29.aspx

    Code:
    string html = browser.DocumentText;
    Last edited by Zaccheus; November 5th, 2010 at 03:55 PM.
    My hobby projects:
    www.rclsoftware.org.uk

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

Featured