473,326 Members | 2,182 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Validating URLs

My app validates web page URLs by using the HttpWebRequest/WebResponse .NET
classes. If URL is ok I'd like to present the user with the title of the web
page.

Anybody knows how to programmatically pick this from the response strem (if
its there at all)?

Bevo
Aug 8 '06 #1
2 1530
Bevo,

You could pass the stream to MSTML (you will have to access this through
COM interop). Then, once you have done that, you can access it through the
object model.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bevo" <Be**@discussions.microsoft.comwrote in message
news:2B**********************************@microsof t.com...
My app validates web page URLs by using the HttpWebRequest/WebResponse
.NET
classes. If URL is ok I'd like to present the user with the title of the
web
page.

Anybody knows how to programmatically pick this from the response strem
(if
its there at all)?

Bevo

Aug 8 '06 #2
Bevo,
Whenever I need to do this type of Web-scraping, getting a particular
element value, etc. I almost always use Simon Mourier's HtmlAgilityPack. It
features an HtmlDocument class that derives from IXPathNavigable which
essentially means your whole web page is the same as an XmlDocument. So, you
could do:

HtmlNode nod=myDoc.DocumentElement.SelectSingleNode("//title");

And then you can get the text, any attributes, etc. with the normal XPath
constructs.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Bevo" wrote:
My app validates web page URLs by using the HttpWebRequest/WebResponse .NET
classes. If URL is ok I'd like to present the user with the title of the web
page.

Anybody knows how to programmatically pick this from the response strem (if
its there at all)?

Bevo
Aug 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bugbear | last post by:
Subject pretty much says it all. I'd like to parse XML (duh!) using Xerces (because its fast, and reliable, and comprehensive, and supports lots of features). I'd like to conform to standards...
5
by: DeMZed | last post by:
Hi, When validating my web site, I've got the following error : ------------------------------ Line 31, column 26: cannot generate system identifier for general entity "PHPSESSID" <a...
9
by: Mark | last post by:
Hi there On this page i get some errors when validating: http://www.keyone.nl/lab/beeldlijn/nl/collection.asp The problem is caused by the use of ASP in my pages. This is the code: <a...
6
by: Robert Reineri | last post by:
Hello, New to the XML world and .NET. I have what I believe to be a simple problem, but I have read the .NET docs till I'm blue in the face and still can't locate a simple example of how to...
0
by: Elias Farah | last post by:
G'day People, I am wondering what is the general concensus about the best way of validating URLs stored in a ms-access table. I can't figure out any VB methods, however I have come across some...
6
by: Alex Bink | last post by:
Hi, I have a validating event on a textbox in which I want to prevent the user to leave the textbox without entering the right data. Only if he clicks on another specific control he is allowed...
0
by: Joe | last post by:
Hi For a while now I have been finding postings of problems with the validating event not firing on controls properly. I too had this problem. The event would fire when clicking on another...
2
by: Chris Dunaway | last post by:
I have a form with a textbox and numerous panels, buttons and other controls. I have handled the textbox Validating and Validated events. The textbox will hold a filename. In the validating...
0
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.