Ready to implement AI with confidence (without sacrificing security)?
Connect your AI agents to apps and data more securely, give users control over the actions AI agents can perform and the data they can access, and enable human confirmation for critical agent actions.
Start building today
Easy-to-use Business Software for the Waste Management Software Industry
DOP Software’s mission is to streamline waste and recycling business’ processes by providing them with dynamic, comprehensive software and services that increase productivity and quality of performance.
Delphi HTMLParser
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 - /.....