Home > Net >  A regular expression. Extraction web page above title, keywords, description of regular table
A regular expression. Extraction web page above title, keywords, description of regular table

Time:11-05

for extracting web page above the title, keywords, description method of regular expressions or
For online, can not only get title extraction, extraction description and keyword



online for methods, only can extract the title, could not extract the description and keywords, regular this, haven't written,


For bosses to help write a bai,

CodePudding user response:

Try this one:
https://www.pixelstech.net/article/1341328160-Regular-expression-to-get-html-meta-description

CodePudding user response:

Recommend an open source component HtmlAgilityPack,
I use it to parse HTML document,

CodePudding user response:

 
A string description=Regex. Match (HTML, "(? (is)? <=& lt; Description meta name=\ '\' \ \ s * content=\ [^ \] "*") (?=\ ") "). The Value;
String keywords=Regex. Match (HTML, "(? (is)? <=& lt; Keywords meta name=\ '\' \ \ s * content=\ [^ \] "*") (?=\ ") "). The Value;