Get Webpage Source Code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    #1

    Get Webpage Source Code

    Hello,

    I am trying to find a way to better analyze the meta tags on my website. I
    would like to get the source code and then parse the code for the meta tags,
    links, etc.

    Can someone give me an example of how to read the source code of a webpage
    from VB.net?

    Thanks,
    Mike


  • Branco Medeiros

    #2
    Re: Get Webpage Source Code

    Mike wrote:
    <snip>
    Can someone give me an example of how to read the source code of a webpage
    from VB.net?
    <snip>

    I'm not sure I understood yoiu correctly, but maybe something in the
    lines of

    <aircode>
    Dim Web As New System.Net.WebC lient
    Dim Ok As Boolean
    Try
    Web.DownloadFil e(RemotePage, LocalFileName)
    Ok = True
    Catch Ex As Exception
    MsgBox(Ex.Messa ge)
    End Try
    </aircode>

    HTH.

    Regards,

    Branco.

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Get Webpage Source Code

      "Mike" <mbaith@yahoo.c omschrieb:
      I am trying to find a way to better analyze the meta tags on my website. I
      would like to get the source code and then parse the code for the meta
      tags, links, etc.
      >
      Can someone give me an example of how to read the source code of a webpage
      from VB.net?
      <URL:http://dotnet.mvps.org/dotnet/code/net/#InternetLoadFi le>

      Parsing an HTML file:

      MSHTML Reference
      <URL:http://msdn.microsoft. com/library/default.asp?url =/workshop/browser/mshtml/reference/reference.asp>

      - or -

      ..NET Html Agility Pack: How to use malformed HTML just like it was
      well-formed XML...
      <URL:http://blogs.msdn.com/smourier/archive/2003/06/04/8265.aspx>

      Download:

      <URL:http://www.codefluent. com/smourier/download/htmlagilitypack .zip>

      - or -

      SgmlReader 1.4
      <URL:http://www.gotdotnet.c om/Community/UserSamples/Details.aspx?Sa mpleGuid=B90FDD CE-E60D-43F8-A5C4-C3BD760564BC>

      If the file read is in XHTML format, you can use the classes contained in
      the 'System.Xml' namespace for reading information from the file.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

      Comment

      Working...