Developed a comprehensive SEO query tools, retrieve keywords wrote,
Public static string Getkeywords (string Url)
{
WebClient wc=new WebClient ();
Wc. Encoding=Encoding. UTF8;
A string of HTML=wc. DownloadString (Url);
String reg="(? <meta name==\ "keywords " content=\ "). *? (?=\ ");
String keywords=Regex. Match (HTML, reg). The Value;
Return keywords;
}
Code above meet the following key words cannot be obtained, could you tell me how to modify the use of meta keywords for the name value of the content of the content?
<meta id="key" name="keywords" content="website building, website production, the enterprise website building, website building, website production company, corporate website production, into a connected"/& gt; <meta id="des" name="description" content="website construction is the company's good marketing method, use SEO network marketing enterprises, the website construction company through the website optimization and website production, trying to do make you satisfied 100% of websites, high-end enterprise website construction company."/& gt;
CodePudding user response:
String reg="(? <=meta (id=\ "key ")? name=\ "keywords " content=\ "). *? (?=\ ");Note that there is space in front of the id
CodePudding user response:
This is best not to use regular, should use the dom parsingThese attributes who appeared who doesn't appear, who first who last the permutation and combination is too much
CodePudding user response: