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;