public static void Main()
string html = "<!doctype html> <html xmlns='http://www.w3.org/1999/xhtml' xmlns:v='urn:schemas-microsoft-com:vml' xmlns:o='urn:schemas-microsoft-com:office:office'> <head> <title>Common App</title> <meta http-equiv='X-UA-Compatible' content='IE=edge'> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'> <meta name='viewport' content='width=device-width,initial-scale=1'> <style type='text/css'> #outlook a { padding: 0; } .ReadMsgBody { width: 100%; } .ExternalClass { width: 100%; } .ExternalClass * { line-height: 100%; } body { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } table, td { border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; } img { border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; } p { display: block; margin: 13px 0; } </style> <style type='text/css'> @media only screen and (max-width:480px) { @-ms-viewport { width: 320px; } @viewport { width: 320px; } } </style> <link href='https://fonts.googleapis.com/css?family=Roboto:400,500' rel='stylesheet' type='text/css'> <style type='text/css'> @import url(https://fonts.googleapis.com/css?family=Roboto:400,500); </style> <style type='text/css'> @media only screen and (min-width:480px) { .mj-column-per-100 { width: 100% !important; max-width: 100%; } .mj-column-per-50 { width: 50% !important; max-width: 50%; } } </style> <style type='text/css'> @media only screen and (max-width:480px) { table.full-width-mobile { width: 100% !important; } td.full-width-mobile { width: auto !important; } } </style> </head> <body style='background-color:#f2f2f2;'> <div style='background-color:#f2f2f2;'> <div style='background:#ffffff;background-color:#ffffff;Margin:0px auto;max-width:600px;'> <table align='center' border='0' cellpadding='0' cellspacing='0' role='presentation' style='background:#ffffff;background-color:#ffffff;width:100%;'> <tbody> <tr> <td style='direction:ltr;font-size:0px;padding:16px 0 0 0;text-align:center;vertical-align:top;'> <div class='mj-column-per-100 outlook-group-fix' style='font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;'> <table border='0' cellpadding='0' cellspacing='0' role='presentation' style='vertical-align:top;' width='100%'> <tr> <td align='left' style='font-size:0px;padding:10px 25px;word-break:break-word;'> <table border='0' cellpadding='0' cellspacing='0' role='presentation' style='border-collapse:collapse;border-spacing:0px;'> <tbody> <tr> <td style='width:150px;'><a href=https://members21.alpha.devca.net target='_blank'><img src='https://content21.alpha.devca.net/Include/Content/Images/email/logo.jpg' alt='Common App' height='auto' style='border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;' width='150'></a></td></tr></tbody></table></td></tr></table></div></td></tr></tbody></table></div><div style='background:#ffffff;background-color:#ffffff;Margin:0px auto;max-width:600px;'><table align='center' border='0' cellpadding='0' cellspacing='0' role='presentation' style='background:#ffffff;background-color:#ffffff;width:100%;'><tbody><tr><td style='direction:ltr;font-size:0px;padding:16px 0;text-align:center;vertical-align:top;'><div style='Margin:0px auto;max-width:600px;'><table align='center' border='0' cellpadding='0' cellspacing='0' role='presentation' style='width:100%;'><tbody><tr><td style='direction:ltr;font-size:0px;padding:0;text-align:center;vertical-align:top;'><div class='mj-column-per-100 outlook-group-fix' style='font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;'><table border='0' cellpadding='0' cellspacing='0' role='presentation' style='vertical-align:top;' width='100%'><tr><td align='left' style='font-size:0px;padding:10px 25px;word-break:break-word;'><div style='font-family:Roboto, sans-serif;font-size:16px;line-height:20px;text-align:left;color:#333333;'><table cellpadding='0' cellspacing='0' border='0' class='ca-mail-row' style='border-collapse: collapse; color: #222222; font-family: arial,sans-serif; font-size: 16px; mso-table-lspace: 0pt; mso-table-rspace: 0pt'><tr><td style='border-collapse: collapse; vertical-align: top' valign='top'><span style='line-height: 150%'>Hello Test,</span><br><p style='line-height: 150%; margin: 1em 0'>Tahseen Dalvi has invited you to access the Control Center.</p><p style='line-height: 150%; margin: 1em 0'><a href=https://members21.alpha.devca.net/sign-in/reset>Create a password</a> to activate your account. Use your email (CC1123140@mailinator.com) to sign in.</p><p style='line-height: 150%;margin: 1em 0'>If you have any questions or need help, contact the <a href=https://membersupport.commonapp.org>Solution Center</a>.</p><p style='line-height: 150%;margin: 1em 0'>Your friends at Common App</p></td></tr></table></div></td></tr></table></div></td></tr></tbody></table></div></td></tr><tr><td align='center' valign='top' style='border-collapse: collapse;'><table border='0' cellpadding='0' cellspacing='0' width='100%' id='footer' style='border-collapse: collapse;border-top: 1px solid #DDDDDD;'><tr><td class='footerLink iconLink firstFooterLink' style='border-collapse: collapse;color: #555555;background-color: #FFFFFF;font-family: Arial;font-size: 14px;line-height: 125%;padding: 10px;width: 24px;'><a href='https://twitter.com/commonapp' target='_blank' style='color: #555555;background-color: #ffffff;font-family: Arial;font-size: 14px;line-height: 125%;text-decoration: none;'><img src='https://content21.alpha.devca.net/Include/Content/Images/email/twitter.jpg' alt='Twitter' style='border: 0 none;height: auto;line-height: 100%;outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;'></a></td><td class='footerLink iconLink' style='border-collapse: collapse;color: #555555;background-color: #FFFFFF;font-family: Arial;font-size: 14px;line-height: 125%;padding: 10px 5px;width: 24px;'><a href='https://www.facebook.com/commonapp' target='_blank' style='color: #555555;background-color: #ffffff;font-family: Arial;font-size: 14px;line-height: 125%;text-decoration: none;'><img src='https://content21.alpha.devca.net/Include/Content/Images/email/facebook.jpg' alt='Facebook' style='border: 0 none;height: auto;line-height: 100%;outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;'></a></td><td class='footerLink iconLink' style='border-collapse: collapse;color: #555555;background-color: #FFFFFF;font-family: Arial;font-size: 14px;line-height: 125%;padding: 10px 5px;width: 24px;'><a href='https://www.youtube.com/user/CommonAppMedia' target='_blank' style='color: #555555;background-color: #ffffff;font-family: Arial;font-size: 14px;line-height: 125%;text-decoration: none;'><img src='https://content21.alpha.devca.net/Include/Content/Images/email/youtube.jpg' alt='Youtube' style='border: 0 none;height: auto;line-height: 100%;outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;'></a></td><td class='footerLink' style='border-collapse: collapse;color: #555555;background-color: #FFFFFF;font-family: Arial;font-size: 14px;line-height: 125%;padding: 10px 5px;'> </td><td class='footerLink' style='border-collapse: collapse;color: #555555;background-color: #FFFFFF;font-family: Arial;font-size: 14px;line-height: 125%;padding: 10px 5px;'><a href=https://membersupport.commonapp.org target='_blank' style='color: #555555;background-color: #ffffff;font-family: Arial;font-size: 14px;line-height: 125%;text-decoration: none;'>Help</a> <a href='http://www.commonapp.org/privacy-policy' target='_blank' style='color: #555555;background-color: #ffffff;font-family: Arial;font-size: 14px;line-height: 125%;text-decoration: none;'>Privacy policy</a></td></tr><tr><td colspan='5' id='footerCopyright' style='border-collapse: collapse;color: #E5E5E5;background-color: #555555;font-family: Arial;font-size: 12px;line-height: 125%;text-align: left;padding: 10px;'>©2021 Common App</td></tr></table></td></tr></table></td></tr></table></body></html>";
HTMLParser(html, "//div");
public static void HTMLParser(string html, string xpath)
var htmlDoc = new HtmlAgilityPack.HtmlDocument();
var htmlBody = htmlDoc.DocumentNode.SelectNodes(xpath);
int num = htmlBody.Count;
foreach (var item in htmlBody)
Console.WriteLine("/" + item.InnerText.Trim() + "/");
Console.WriteLine("+++++++++++++++++++++++++++++++++++");