473,581 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HtmlDocument like class for HtmlReader/

Is there a class I can use which loads HtmlDocument and performs
default html validation to see if the document is a valid html
document like XDocument? HtmlDocument seems to me only used to create
HtmlDocument and there are no methods to load the existing HTML
document.
Thanks,
Jul 30 '08 #1
2 3987
On Jul 30, 11:04*am, CSharper <cshar...@gmx.c omwrote:
Is there a class I can use which loads HtmlDocument and performs
default html validation to see if the document is a valid html
document like XDocument? HtmlDocument seems to me only used to create
HtmlDocument and there are no methods to load the existing HTML
document.
Thanks,
Hi,

not really, you could try to load it in a WebBrowser (not sure if
WebBrowser has an event for errors)
the thing is that HTML is VERY distinct than XML, depending of the
browser it might be valid or not.
Jul 30 '08 #2
On Jul 30, 7:04*pm, CSharper <cshar...@gmx.c omwrote:
Is there a class I can use which loads HtmlDocument and performs
default html validation to see if the document is a valid html
document like XDocument? HtmlDocument seems to me only used to create
HtmlDocument and there are no methods to load the existing HTML
document.
Have a look at this:

http://www.codeplex.com/htmlagilitypack

But pay attention to the license - it is copyleft.
Jul 30 '08 #3

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

Similar topics

9
6326
by: James Marshall | last post by:
I'm writing a library where I want to override document.write(), but for all document objects; thus, I want to put it in the prototype. I tried Document.prototype.write= my_doc_write ; but it didn't work. I discovered that this seemed to work: HTMLDocument.prototype.write= my_doc_write ; Why does HTMLDocument work here but not...
1
8762
by: kavitha | last post by:
Can we construct a HTMLDocument? I mean something like this string outerHTML = "<HTML><BODY>Some sample text...</BODY></HTML>"; HTMLDocument doc = new HTMLDocument(); doc.addElement("HTML"); doc.all.item("HTML", 0).outerHTML = outerHTML; Actually I have a url, I need to build a HTMLDocument
8
8204
by: pierre | last post by:
Hi, I got a problem which may easy to resolve, but I can't find any issue: I want to parse html files, so, I want first get it from an url, and I do like that: Dim objMSHTML As New mshtml.HTMLDocument() Dim objDocument As mshtml.HTMLDocument objDocument = objMSHTML.createDocumentFromUrl("http://www.google.fr",
0
1954
by: Filippo Bettinaglio | last post by:
VS2005, C# I have developed a UserControl embedded in a HTML web page. And I can access to the DOM with the following code: HTML page: …….. <BODY onload=loadDoc()> …….
2
14790
by: Paul Hemans | last post by:
I am very new at .Net. I have a small project where I need to manipulate the contents of a web page. I have a form with a web browser control (webBrowser1) on it. Within the webBrowser1_DocumentCompleted method I have the following code. mshtml.HTMLDocument oDoc = new HTMLDocumentClass(); oDoc = (mshtml.HTMLDocument)webBrowser1.Document;
9
4076
by: Le Minh | last post by:
Hi, i want to write a program. Input of this is HTML source code of a web page and output is a treeview representation it structure. I want to write it with HtmlDocument in .net framework 2.0. how i write it?
0
1458
by: forcedfx | last post by:
I'm faced with a bit of a conundrum. I'm trying to post a form using the HTMLDocument object. I've got the form posting working prefectly, however, in order to retrieve the HTML page that contains the form element I need to authenticate wih the server. Using Internet Explorer or FireFox when retrieving the HTML page I am presented with the...
0
1869
by: nickin4u | last post by:
I have a application that is used to automate certain task, I have been using mshtml.HTMLDocument class but certain events like click a button do not fire. I have tried a number of combinations but in vain. I was now trying to use System.Windows.Forms.Htmldocument class; here is the code Dim do1 As System.Windows.Forms.HtmlDocument =...
3
1450
by: sam6 | last post by:
Hi, I have developed a small dll class which extracts me the innerhtml of a htmldocument.I am using mshtml lib in achieving the same.The code runs fine when using from another EXE.When I try to call the api from VSTS TestMethod,it fails. It fails to build the htmldocument of the input html file.I get an error: TestMethod1 threw exception: ...
0
7857
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7788
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8137
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8163
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6545
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5355
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1397
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.