Delphi HTML Parser
This module lets you work with HTML documents as DOM tree and use XPath for searching tags.
It is very simple way to parse HTML.

This tested with version Delphi XE5,6

Usage

Add in Uses parser.pas;
begin
HtmlTxt:= ''; //here your html
NodeList:= TNodeList.Create;
ValueList:= TStringList.Create;

DomTree:= TDomTree.Create;
DomTreeNode:= DomTree.RootNode;
If DomTreeNode.RunParse(HtmlTxt) then
begin
{your code
example:
DomTreeNode.FindXPath('//*[@id="TopBox"]/div[1]/div[@class="draw default"]'),NodeList,ValueList)}
end;
end;

Xpath support:
attributes - //*[@id="TopBox"]/div/@class
comment - //*[@id="TopBox"]/div/comment()[3]
text - //*[@id="TopBox"]/div/text()[2]
previous level - /../div[@class="draw default"]/img[2]/@alt

partial coincidence by search in value of attribute:

/div[@class="draw] returned nodes [[div class="draw default"],[div class="draw"], [div class="draw any"]..]
like Xpath's function contains

Project Samples

Project Activity

See All Activity >

Follow HTML XHTML Parser + XPath

HTML XHTML Parser + XPath Web Site

Other Useful Business Software
Enterprise-grade ITSM, for every business Icon
Enterprise-grade ITSM, for every business

Give your IT, operations, and business teams the ability to deliver exceptional services—without the complexity.

Freshservice is an intuitive, AI-powered platform that helps IT, operations, and business teams deliver exceptional service without the usual complexity. Automate repetitive tasks, resolve issues faster, and provide seamless support across the organization. From managing incidents and assets to driving smarter decisions, Freshservice makes it easy to stay efficient and scale with confidence.
Try it Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of HTML XHTML Parser + XPath!

Additional Project Details

Operating Systems

Windows

Programming Language

Delphi/Kylix, Lazarus

Related Categories

Delphi/Kylix HTML XHTML, Delphi/Kylix Internet Software, Delphi/Kylix Libraries, Lazarus HTML XHTML, Lazarus Internet Software, Lazarus Libraries

Registered

2014-10-23