Get Webpage Source Code

M

Mike

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
 
B

Branco Medeiros

Mike wrote:
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.WebClient
Dim Ok As Boolean
Try
Web.DownloadFile(RemotePage, LocalFileName)
Ok = True
Catch Ex As Exception
MsgBox(Ex.Message)
End Try
</aircode>

HTH.

Regards,

Branco.
 
H

Herfried K. Wagner [MVP]

Mike said:
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/#InternetLoadFile>

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.com/Community/...mpleGuid=B90FDDCE-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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top