Solved

Parsing a string C#, From html screen scrape

Posted on 2008-09-30
10
2,194 Views
Last Modified: 2013-12-17
I'm doing a html screen scrape and I need to format the information that I get back.

I am able to scrape it in a string variable. I now need to search the string and extact information.  this is the string:
(see below)

I need outputted with is in between the <b> tags. example:

string prodType = "Xpresspost"
DateTime expectedDate = new DateTime(2008,10,01);
string refNumber = "20480";

I also need to find the text "Item arrived at postal facility", look in that same table row and get the ACTUAL date
(in this case "new DateTime(2008,09,26)")

I hope that is clear. Basically read the string and based on that declare C# variables to use later on.

Many thanks!

<!-- Result Table -->

												

<strong>Product Type</strong>:

<b>Xpresspost</b>

								

								

<br/>

<strong>Service Standard Delivery Date</strong>:

<b>2008/10/01</b>

								

<br/>

<strong>Reference Number 1</strong>:

<b>20480</b>

								

								

<br/>

<strong>Reference Number 2</strong>:

<b>A : 0.5</b>

								

								

</p>

							

<!--  START error Section  -->	

							

<!--  END error Section  -->	

							

<!--  START Header Section -->

							

<table border="0" cellpadding="0" cellspacing="0" id="tableDetailedItemInformation" class="searchInfo">

<tr class="title">

<th class="Headercolumn1">Date of Event</th>

<th class="Headercolumn1">Time of Event</th>

<th class="Headercolumn1">Location</th>

<th class="Headercolumn1">Description</th>

<th class="Headercolumn1">Retail Location</th>

<th class="Headercolumn1">Signatory Name</th>

</tr>

							

<!--  END Header Section -->	

<!--  START Detail Section -->
 

<tr class="">

<td >2008/09/26</td>

<td >17:21</td>

<td>

STE THERESE DE BLAINVILLE, QC

</td>

<td >

										

Item arrived at postal facility

										

</td>

<td >

</td>

	<td>

	
 

		&nbsp;

	

</td>

</tr>
 

	<tr class="">

	<td >2008/09/26</td>

	<td >14:58</td>

	<td>

	

		STE THERESE DE BLAINVILLE, QC

 

	</td>

	<td >
 

		An order has been electronically submitted
 

	</td>

	<td >
 
 

		&nbsp;
 

	</td>

	<td>

	
 

		&nbsp;

	

</td>

</tr>
 
 
 

</table>

Open in new window

0
Comment
Question by:copyPasteGhost
  • 6
  • 3
10 Comments
 
LVL 18

Expert Comment

by:Priest04
ID: 22606730
One way:

Goran
List<string> list = new List<string>();
 

string data = textBox1.Text;
 

int i = 0;

int start = 0;

int end = 0;

bool processing = true;

while (processing)

{

    start = data.IndexOf("<b>", start + 1);

    end = data.IndexOf("</b>", start + 1);
 

    if (start != -1 && end != -1)

    {

        list.Add(data.Substring(start + 3, end - start - 3));

    }

    else

    {

        processing = false;

    }

}

Open in new window

0
 
LVL 13

Author Comment

by:copyPasteGhost
ID: 22607005
I gave just a sampling of the html. there may be other <b> that I have no intrest in.

I really need to first find the string "<strong>Product Type</strong>"  and then extract the text between the <b> tags.

same for "<strong>Service Standard Delivery Date</strong>"
                                          
and for "<strong>Reference Number 1</strong>"
0
 
LVL 13

Author Comment

by:copyPasteGhost
ID: 22607018
also that doesn't solve my other problem with

>>I also need to find the text "Item arrived at postal facility", look in that same table row and get the ACTUAL date
>>(in this case "new DateTime(2008,09,26)")
0
 
LVL 23

Expert Comment

by:Tiggerito
ID: 22614103
I would use Regex to do it.

First I would convert the input html into a single line by removing new lines. I find this makes it easier to getting regex working.

Then its down to working out the regex expressions...

For your strong/b combination something like this should work:

<strong>(?<name>.*?)</strong>:.*?<b>(?<value>.*?)</b>

Each match would return named captures for 'name' and 'value'. my regex tool shows the following results based on your html:

    name => Product Type
    value => Xpresspost
   
    name => Service Standard Delivery Date
    value => 2008/10/01
   
    name => Reference Number 1
    value => 20480
   
    name => Reference Number 2
    value => A : 0.5
   
To gather your date this regex seems to work

Item arrived at postal facility.*<td >(?<submitteddate>[0-9/]*)</td>

Where the named capture of 'submitteddate' will have your result...

    submitteddate => 2008/09/26
   
You could improve and refine these expressions with more knowledge of what html may be produced.
0
 
LVL 13

Author Comment

by:copyPasteGhost
ID: 22614177
I'm guessing you are using a generic dictionary to store the name, value pairs?

if so, do you have that code too...

I'm new to generics....
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 13

Author Comment

by:copyPasteGhost
ID: 22614183
or are you just doing a match and then a foreach on the match collection?
0
 
LVL 23

Expert Comment

by:Tiggerito
ID: 22614716
Yep,

This may help you get started (not tested, compiled and based on a few wines):


        Regex pairsRegex = new Regex(@"<strong>(?<name>.*?)</strong>:.*?<b>(?<value>.*?)</b>"); 

		Regex dateRegex = new Regex(@"Item arrived at postal facility.*<td >(?<submitteddate>[0-9/]*)</td>"); 

		

		string htmlSource = "bla";
 

		Match match;

		

		for (match = pairsRegex.Match(htmlSource); match.Success; match = match.NextMatch())

		{

			string name = match.Groups["name"].Value;

			string val  = match.Groups["value"].Value;

			

			// do thing with data

		}

		

		match = dateRegex.Match(htmlSource);

		

		if (match.Success)

		{

			string date = match.Groups["submitteddate"].Value;

			

			// do date stuff

		}

Open in new window

0
 
LVL 13

Author Comment

by:copyPasteGhost
ID: 22614758
cool I'll play with that for a bit. I'll keep you posted.

thanks!
0
 
LVL 13

Author Comment

by:copyPasteGhost
ID: 22618640
ok finally got some time to try it out. It doesn't seem to be working...

here is the contents of the string:
            webPageContent      "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head><!-- <script type=\"text/javascript\" language=\"javascript\" src=\"js/flash-fix.js\"></script><script type=\"text/javascript\" language=\"javascript\" src=\"js/nonflash-e.js\"></script>--><script language=\"JavaScript\">var segment = \"common\";var language = \"e\";var omniLang = \"English\";/* (HM_Loader.js / HM_ScriptNS4.js /HM_ScriptIE4.js / HM_ScriptDOM.js)   Copyright 2001 Peter Belesis.   http://www.webreference.com/dhtml/   All rights reserved.   Used under license.   License Holder: Fuel Industries (www.fuelindustries.com)*/HM_DOM = (document.getElementById) ? true : false;HM_NS4 = (document.layers) ? true : false;HM_IE = (document.all) ? true : false;HM_IE4 = HM_IE && !HM_DOM;HM_Mac = (navigator.appVersion.indexOf(\"Mac\") != -1);HM_IE4M = HM_IE4 && HM_Mac;HM_IsMenu = (HM_DOM || HM_NS4 || (HM_IE4 && !HM_IE4M));//HM_IsTopNavDropDown = HM_IsMenu;HM_IsTopNavDropDown = false;HM_BrowserString = HM_NS4 ? \"NS4\" : HM_DOM ? \"DOM\" : \"IE4\";if(window.event + \"\" == \"undefined\") event = null;function HM_f_PopUp(){return false};function HM_f_PopDown(){return false};popUp = HM_f_PopUp;popDown = HM_f_PopDown;// Define menu default look here// (left nav flyouts use this)HM_GL_MenuWidth          = 145;HM_GL_FontFamily         = \"Arial, Helvetica\";HM_GL_FontSize           = 9;HM_GL_FontBold           = false;HM_GL_FontItalic         = false;HM_GL_FontColor          = \"#0C2577\";HM_GL_FontColorOver      = \"#0C2577\";HM_GL_BGColor            = \"#E7EFF7\";HM_GL_BGColorOver        = \"#BFCEDD\";HM_GL_ItemPadding        = 2;HM_GL_BorderWidth        = 1;HM_GL_BorderColor        = \"#082073\";HM_GL_BorderStyle        = \"solid\";HM_GL_SeparatorSize      = 1;HM_GL_SeparatorColor     = \"#082073\";HM_GL_ImageSrc           = \"/library/images/template/tri.gif\";HM_GL_ImageSrcLeft       = \"\";HM_GL_ImageSize          = 7;HM_GL_ImageHorizSpace    = 0;HM_GL_ImageVertSpace     = 0;HM_GL_KeepHilite         = false;HM_GL_ClickStart         = false;HM_GL_ClickKill          = false;HM_GL_ChildOverlap       = 1;HM_GL_ChildOffset        = -1;HM_GL_ChildPerCentOver   = null;HM_GL_TopSecondsVisible  = .5;HM_GL_StatusDisplayBuild = 0;HM_GL_StatusDisplayLink  = 1;HM_GL_UponDisplay        = null;HM_GL_UponHide           = null;HM_GL_RightToLeft        = false;//HM_GL_CreateTopOnly      = HM_NS4 ? true : false;HM_GL_CreateTopOnly     = true;HM_GL_ShowLinkCursor     = true;// the following function is included to illustrate the improved JS expression handling of// the left_position and top_position parameters// you may delete if you have no use for itfunction HM_f_CenterMenu(topmenuid) {var TheMenu = HM_DOM ? document.getElementById(topmenuid) : HM_IE4 ? document.all(topmenuid) : eval(\"window.\" + topmenuid);var TheMenuWidth = HM_DOM ? parseInt(TheMenu.style.width) : HM_IE4 ? TheMenu.style.pixelWidth : TheMenu.clip.width;var TheWindowWidth = HM_IE ? document.body.clientWidth : window.innerWidth;return ((TheWindowWidth-TheMenuWidth) / 2);}if(HM_IsMenu) {document.write(\"<SCR\" + \"IPT LANGUAGE='JavaScript1.2' SRC='./js/pool_quicklinks-\" + segment + '-' + language + \".js' TYPE='text/javascript'><\\/SCR\" + \"IPT>\");document.write(\"<SCR\" + \"IPT LANGUAGE='JavaScript1.2' SRC='https://ssl.postescanada-canadapost.ca/library/js/menus-\" + segment + '-' + language + \".js' TYPE='text/javascript'><\\/SCR\" + \"IPT>\");document.write(\"<SCR\" + \"IPT LANGUAGE='JavaScript1.2' SRC='https://ssl.postescanada-canadapost.ca/library/js/hm_script\"+ HM_BrowserString +\".js' TYPE='text/javascript'><\\/SCR\" + \"IPT>\");}</script><title id=\"theTitle\">Canada Post - </title><link rel=\"stylesheet\" href=\"css/cpc.css\" type=\"text/css\"></link><meta name=\"generator\" content=\"Hand Coded\"></meta><meta name=\"author\" content=\"Canada Post\"></meta><meta name=\"description\" content=\"\"></meta><meta name=\"keywords\" content=\"\"></meta><meta http-equiv=\"content-language\" content=\"EN\"><script language=\"JavaScript\" src=\"./js/pool_common.js\" type=\"text/javascript\"></script><script language=\"JavaScript\" src=\"https://ssl.postescanada-canadapost.ca/library/js/popup.js\" type=\"text/javascript\"></script><script language=\"JavaScript\" src=\"https://ssl.postescanada-canadapost.ca/library/js/searchbox_header.js\" type=\"text/javascript\"></script><script>// Name this windowtop.name = \"CPC\";top.focus();// Preload the mouseover imagespreload( \"https://ssl.postescanada-canadapost.ca/library/images/template/_language-e.gif\" );preload( \"https://ssl.postescanada-canadapost.ca/library/images/template/_pcl-e.gif\" );preload( \"https://ssl.postescanada-canadapost.ca/library/images/template/_ship-e.gif\" );preload( \"https://ssl.postescanada-canadapost.ca/library/images/template/_tap-e.gif\" );preload( \"https://ssl.postescanada-canadapost.ca/library/images/template/_pol-e.gif\" );</script><style>.LEGAL_{    FONT-SIZE: 10px;    COLOR: #333333;     FONT-FAMILY: Arial, Helvetica}</style></head><body bgcolor=\"#FFFFFF\" marginwidth=\"0\" marginheight=\"0\" topmargin=\"0\" leftmargin=\"0\" onload=\"doPreload();\" class=\"body.emo\"><div class=\"noindex\"><script language=\"JavaScript\" type=\"text/javascript\"><!--var segment = \"common\";var language = \"e\";if(window.event + \"\" == \"undefined\") event = null;function HM_f_PopUp(){return false};function HM_f_PopDown(){return false};popUp = HM_f_PopUp;popDown = HM_f_PopDown;function doPreload(){  for(i=1;i<=2;i++)      preload('https://ssl.postescanada-canadapost.ca/library/images/leftnav/common/_m'+i+'-e.gif');  }doPreload();function getnavURL(nav){  if( menuurl[nav] )  {    var base = location.protocol + \"//\" + location.hostname;    return(base + menuurl[nav])  }  else    //return(\"Menu URL for \" + nav + \" is undefined!\");return(\"\");}function leftnav(nav){  if( menuurl[nav] )    location = menuurl[nav];//  else//    alert(\"Menu URL for \" + nav + \" is undefined!\");}//--></script><!-- Search Template --><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"767\"><tr><td valign=\"top\" width=\"145\"><a href=\"https://ssl.postescanada-canadapost.ca/segment-e.asp\"><img src=\"https://ssl.postescanada-canadapost.ca/library/images/template/logo-e.gif\" width=\"145\" height=\"56\" border=\"0\" alt=\"To Home page.\"></img></a></td>  <td valign=\"top\" width=\"484\"><img src=\"https://ssl.postescanada-canadapost.ca/library/images/template/backgrounds/track_a_package.jpg\" width=\"484\" height=\"56\" border=\"0\" alt=\"\"></img></td>  <td valign=\"top\" width=\"138\"><a href=\"https://em.canadapost.ca/emo_business/basicPin.do?language=fr\" onmouseover=\"mover('language-e','template');\" onmouseout=\"mout('language-e','template');\" onclick=\"setCookie('LANG','e');\"><img src=\"https://ssl.postescanada-canadapost.ca/library/images/template/language-e.gif\" name=\"language-e\" width=\"138\" height=\"56\" border=\"0\" alt=\"Vers la version Français du site\"></img></a></td>  </tr></table><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"shortcutbackground\" width=\"767\"><form action=\"https://ssl.postescanada-canadapost.ca/search/default-e.aspx\" name=\"searchForm\" method=\"POST\" onSubmit=\"return doSearch(this)\" style=\"padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;\"><input type=\"hidden\" name=\"Language\" value=\"en\" ><input type=\"hidden\" name=\"TextOnly\" value=\"false\" ID=\"Hidden4\">  <input id=\"query\" type=\"hidden\" name=\"Query\">    <tr><td width=\"145\" align=\"left\"><script language=\"javascript\" src=\"https://ssl.postescanada-canadapost.ca/library/js/segment/clearText.js\"></script><script language=\"javascript\" src=\"https://ssl.postescanada-canadapost.ca/library/js/shortcut_search.js\"></script><table width=\"130\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin-left:5px;\">     <tr onclick=\"return !showMenu('2', event);\">       <script language=\"JavaScript\">  document.write( \"<td width=\\\"120\\\" class=\\\"shortcutdropsel\\\"><span style=\\\"cursor:default\\\" >Shortcut to... &nbsp;&nbsp;&nbsp;</span></td>\");      document.write( \"<td align=\\\"right\\\" width=\\\"16\\\" class=\\\"shortcutarrow\\\"><img src=\\\"https://ssl.postescanada-canadapost.ca/library/images/segment/arrowdrop.gif\\\" width=\\\"16\\\" height=\\\"14\\\" border=\\\"0\\\" /><br /></td>\");      </script>      <noscript>      <td width=\\\"145\\\" class=\\\"shortcutdropsel\\\">&nbsp;</td>      </noscript>           </tr> </table><div id=\"menu2\" class=\"menu\" style=\"position:absolute; display:none;\">  <div id=\"Div3\" style='position:absolute; overflow:auto; top: 0px; left: 4px; width:190px; height:200px;  background-color: #D9E6EF; padding-top: 0px; border: 1px solid #656565; margin-right:0px; margin-left:0px;'>  <table width=\"190\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >      <script language=\"JavaScript\">// Display the shortcuts    document.write( \"<tr name='quicklink' class='TOPNAVDROPDOWNSELECT'>\");   document.write( \"<td width=\\\"190\\\" >\");  document.write( \"<span style=\\\"cursor:default\\\">\");    outputShortcuts();  document.write( \"</td>\");  document.write( \"</tr>\");    document.write( \"</span>\");</script></table></div> </div></td><td valign=\"top\" width=\"120\"><a href=\"https://ssl.postescanada-canadapost.ca/common/tools/pcl/bin/advanced-e.asp\" onmouseover=\"mover('pcl-e','template');\" onmouseout=\"mout('pcl-e','template');\"><img src=\"https://ssl.postescanada-canadapost.ca/library/images/template/pcl-e.gif\" name=\"pcl-e\" width=\"120\" height=\"27\" border=\"0\" alt=\"Find a Postal Code\"></img></a></td><td valign=\"top\" width=\"119\"><a href=\"https://ssl.postescanada-canadapost.ca/ship_now/default-e.asp\" onmouseover=\"mover('ship-e','template');\" onmouseout=\"mout('ship-e','template');\"><img src=\"https://ssl.postescanada-canadapost.ca/library/images/template/ship-e.gif\" name=\"ship-e\" width=\"119\" height=\"27\" border=\"0\" alt=\"Ship\"></img></a></td><td valign=\"top\" width=\"121\"><a href=\"https://em.canadapost.ca/emo_business/basicPin.do?language=en\" onmouseover=\"mover('tap-e','template');\" onmouseout=\"mout('tap-e','template');\"><img src=\"https://ssl.postescanada-canadapost.ca/library/images/template/tap-e.gif\" name=\"tap-e\" width=\"121\" height=\"27\" border=\"0\" alt=\"Track a Package\"></img></a></td><td valign=\"top\" width=\"124\"><a href=\"https://ssl.postescanada-canadapost.ca/common/tools/pol/bin/search-e.asp\" onmouseover=\"mover('pol-e','template');\" onmouseout=\"mout('pol-e','template');\"><img src=\"https://ssl.postescanada-canadapost.ca/library/images/template/pol-e.gif\" name=\"pol-e\" width=\"124\" height=\"27\" border=\"0\" alt=\"Find a Post Office\"></img></a></td><td valign=\"top\" width=\"114\" align=\"center\" valign=\"middle\" background=\"https://ssl.postescanada-canadapost.ca/library/images/template/topnavback.gif\" width=2 height=27 alt=\"\">        <input type=\"text\" ID=\"Text3\" name=\"QueryText\" value=\"Search\" class=\"searchBox\" onfocus=\"if (this.value=='Search') {this.value= '';}\"></input>     </td>    <script language=\"JavaScript\">    document.write( \"<td valign=\\\"top\\\" width=\\\"24\\\"><input type=image src=\\\"https://ssl.postescanada-canadapost.ca/library/images/template/searchsubmit.gif\\\" name=\\\"searchsubmit\\\" alt=\\\"Search\\\" width=\\\"24\\\" height=\\\"27\\\" border=\\\"0\\\" onmouseover=\\\"mover('searchsubmit','template');\\\" onmouseout=\\\"mout('searchsubmit','template');\\\"></td>\");    </script>    <noscript><td valign=\"top\" width=\"24\"><input type=image src=\"https://ssl.postescanada-canadapost.ca/library/images/template/searchsubmit.gif\" alt=\"Search\" width=\"24\" height=\"27\" border=\"0\" ID=\"Submit1\" name=\"searchsubmit\" onmouseover=\"mover('searchsubmit','template');\" onmouseout=\"mout('searchsubmit','template');\"></td>    </noscript></tr></form></table><!-- End Search Template --></div><!-- BREADCRUMBS --><div class=\"noindex\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"766\"><tr><td width=146 valign=top><img src=\"https://ssl.postescanada-canadapost.ca/library/images/leftnav/common/header-e.gif\" width=146 height=25 border=0 alt=\"\"></img></td>  <td width=\"482\" valign=\"top\">    <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"482\">    <tr>    <td valign=\"middle\" height=\"25\" background=\"https://ssl.postescanada-canadapost.ca/library/images/template/border/lightblue/subnavback.gif\" width=\"100%\" alt=\"\">    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"https://ssl.postescanada-canadapost.ca/segment-e.asp\" class=\"CRUMBS\">Home</a><span class=\"CRUMBSARROW\"> > </span><a href=\"https://ssl.postescanada-canadapost.ca/common/tools/default-e.asp\" class=\"CRUMBSARROW\"><span class=\"CRUMBSONPAGERED\">Online Tools</span></a>    </td>            <td background=\"https://ssl.postescanada-canadapost.ca/library/images/template/border/lightblue/subnavback.gif\" width=\"20\" height=\"25\" alt=\"\" border=\"0\"><img src=\"https://ssl.postescanada-canadapost.ca/library/images/dot.gif\" width=\"1\" height=\"25\" border=\"0\" alt=\"\"></img></td>    </tr>    </table>  </td>  <td width=\"138\"><img src=\"https://ssl.postescanada-canadapost.ca/library/images/template/border/lightblue/subnavright.gif\" width=\"138\" height=\"25\" border=\"0\" alt=\"\"></img></td></tr></table><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><!-- First column --><td width=\"146\" valign=\"top\">  <!-- LEFT NAV -->   <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"> <tr><td><a href=\"https://ssl.postescanada-canadapost.ca/personal/default-e.asp\" onmouseover=\"nav('common','m1','_','e');\" onmouseout=\"self.status='';nav('common','m1','','e');return(true);\"><img name=\"m1\" id=\"m1\" src=\"https://ssl.postescanada-canadapost.ca/library/images/leftnav/common/m1-e.gif\" width=\"145\" alt=\"personal\" border=\"0\"></img></a></td></tr><tr><td><a href=\"https://ssl.postescanada-canadapost.ca/business/default-e.asp\" onmouseover=\"nav('common','m2','_','e');\" onmouseout=\"self.status='';nav('common','m2','','e');return(true);\"><img name=\"m2\" id=\"m2\" src=\"https://ssl.postescanada-canadapost.ca/library/images/leftnav/common/m2-e.gif\" width=\"145\" alt=\"business\" border=\"0\"></img></a></td></tr><tr><td><img src=\"https://ssl.postescanada-canadapost.ca/library/images/leftnav/common/bottom.gif\" width=\"145\" height=\"11\"></img></td></tr></table>  <!-- END LEFT NAV --></td><!-- END First column --><td width=\"620\" valign=\"top\" background=\"https://ssl.postescanada-canadapost.ca/library/images/template/border/lightblue/widepagecontentback.gif\" alt=\"\"><!-- Regular Page -->    <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"482\">  <tr>  <td align=\"left\" valign=\"top\" width=\"482\"><img src='https://ssl.postescanada-canadapost.ca/library/images/dot.gif' width=\"482\" height=\"19\" border=\"0\" alt=\"\"></img></td>  <td align=\"left\" valign=\"top\" bgcolor=\"#FAF7CF\" width=\"138\"><img src='https://ssl.postescanada-canadapost.ca/library/images/template/border/lightblue/onpagesubnavtop.gif' width=\"138\" height=\"19\" border=\"0\" alt=\"\"></img><br>  <!-- Omniture Library -->  <td><script language=\"JavaScript\" type=\"text/javascript\" src=\"library/include/webtracking/s_code_20080502.js\"></script></td> </tr>  </table><!-- Content begins -->  <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"left\" width=\"604\">  <tr>  <td align=\"left\" valign=\"top\"><img src=\"https://ssl.postescanada-canadapost.ca/library/images/dot.gif\" width=\"16\" height=\"1\" border=\"0\" alt=\"\"></img></td>  <td width=\"588\" border=\"0\" background=\"\"></div> <!--  <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"575\"><tr><td id=\"flashcontent\" style=\"width:300;height:100\"><script type=\"text/javascript\"> var fo = new FlashObject(\"picture/pool/en/track_package-e.swf\", \"bannercontainer\", 575, 100, \"7\", \"#FFFFFF\"); fo.addParam(\"quality\", \"high\");fo.write(\"flashcontent\");</script></td></tr></table>--><!-- Content Starts --><script language=\"JavaScript\" type=\"text/javascript\" src=\"js/omnitureSupV2.js\"></script><link href=\"css/style.css\" rel=\"stylesheet\" type=\"text/css\"><script language=\"JavaScript\" type=\"text/javascript\" src=\"js/UIscript_v2.js\"></script><script language=\"JavaScript\" type=\"text/javascript\" src=\"js/zpoolcommon.js\"></script><script language=\"JavaScript\" src='./js/zisa_popup.js'></script><script>function submitReferenceNumber(obj) {if (obj==\"\") return;var formObj = eval(\"document.\" + obj);if (formObj.referenceNumber.value==\"\") {alert('No Reference number was submitted. Please enter a number and click Track.');formObj.referenceNumber.focus();return;}    if (!validateReferenceNumber(formObj.referenceNumber.value)) {        alert('Invalid characters in the input fields. Please check your entries and try again.');        formObj.referenceNumber.focus();        return;    }     var _dateDiff = dateDiff(formObj.startDate.value,                             formObj.endDate.value,                             'YYYY/MM/DD',                             'EN');                                     if (_dateDiff>0) {         alert('The Start date you have selected occurs after the selected End date. Please reselect an earlier Start date by clicking on the calendar icon and resubmit - '+ _dateDiff);        return;    }formObj.referenceNumberPressed.value = 'true';formObj.submit();}function submitPIN(obj) {if (obj==\"\") return;var formObj = eval(\"document.\" + obj);if (!validate(formObj.temp_trkid1.value)) {alert('Invalid characters in the input fields. Please check your entries and try again.');formObj.temp_trkid1.focus();return;} if (formObj.temp_trkid1.value==\"\") {alert('No Item number was submitted. Please enter a number and click Track.');formObj.temp_trkid1.focus();return;}formObj.trackingId.value=formObj.temp_trkid1.value;formObj.trackingCode.value='PIN';formObj.referenceNumberPressed.value = 'false';formObj.submit();}function submitDNC(obj) {if (obj==\"\") return;var formObj = eval(\"document.\" + obj);if (!validate(formObj.temp_trkid2.value)) {alert('Invalid characters in the input fields. Please check your entries and try again.');formObj.temp_trkid2.focus();return;} if (formObj.temp_trkid2.value==\"\") {alert('No Delivery Notification Card number was submitted. Please enter a number and click Track.');formObj.temp_trkid2.focus();return;}formObj.trackingId.value=formObj.temp_trkid2.value;formObj.trackingCode.value='DNC';formObj.referenceNumberPressed.value = 'false';formObj.submit();}/*********************************    Pin Summary Filter**********************************/function submitPinFilterForm() {if (!validate(document.scemForm.originPostalCode.value) ||!validate(document.scemForm.destPostalCode.value) ||!validate(document.scemForm.startDate.value) ||!validate(document.scemForm.endDate.value) ||!validate(document.scemForm.destProv.value)) {alert('Invalid characters in the input fields. Please check your entries and try again.');return;} // Validate Origin Postal Codeif (document.scemForm.originPostalCode.value!=\"\") {fsa = document.scemForm.originPostalCode.value.toUpperCase();document.scemForm.originPostalCode.value = fsa;if (!isPostCode(fsa)){alert('The Postal Code for this item is incorrect. Please re-enter the first three characters of the Originating Postal Code and click Submit.');return;}}// Validate Dest Postal Codeif (document.scemForm.destSearchType[1].checked) {if (document.scemForm.destPostalCode.value!=\"\") {fsa = document.scemForm.destPostalCode.value.toUpperCase();document.scemForm.destPostalCode.value = fsa;if (!isPostCode(fsa)){alert('The Postal Code for this item is incorrect. Please re-enter the first three characters of the Destination Postal Code and click Submit.');return;}}}// Both dates have to existif (document.scemForm.startDate.value!=\"\" && document.scemForm.endDate.value==\"\") {alert('No End Date was selected. Please enter an End Date by clicking on the calendar icon and resubmit');return;}if (document.scemForm.startDate.value==\"\" && document.scemForm.endDate.value!=\"\") {alert('No Start date was selected. Please enter a Start date by clicking on the calendar icon and resubmit');return;}document.scemForm.submit();}/*********************************    Email **********************************/function submitEmail(obj, callValidateEvents) {if (obj==\"\") return false;var frmObj = eval(\"document.\" + obj);var email1=null;var email2=null;var email3=null;var email4=null;(frmObj.email1 != null) ? email1 = frmObj.email1.value : \"\";(frmObj.email2 != null) ? email2 = frmObj.email2.value : \"\";(frmObj.email3 != null) ? email3 = frmObj.email3.value : \"\";(frmObj.email4 != null) ? email4 = frmObj.email4.value : \"\";if ( (email1 == null || email1==\"\") &&  (email2 == null || email2==\"\") && (email3 == null || email3==\"\") && (email4 == null || email4==\"\") ){alert(\"No email address was submitted. Please enter a valid address and click Submit.\");return false;}if (email1 != null && email1!=\"\" && email1.indexOf(\"@\")<0) {alert(\"The email address submitted is not valid. Please re-enter the address and click Submit.\");return false;} if (email2 != null && email2!=\"\" && email2.indexOf(\"@\")<0) {alert(\"The email address submitted is not valid. Please re-enter the address and click Submit.\");return false;}if (email3 != null && email3!=\"\" && email3.indexOf(\"@\")<0) {alert(\"The email address submitted is not valid. Please re-enter the address and click Submit.\");return false;}if (email4 != null && email4!=\"\" && email4.indexOf(\"@\")<0) {alert(\"The email address submitted is not valid. Please re-enter the address and click Submit.\");return false;}if ( callValidateEvents != null && callValidateEvents == true ) {if ( ! validateEvents(obj) ) {return false;}}return true;//formObj.submit();}function validateEvents(obj) {var retVal = true;var frmObj = eval(\"document.\" + obj);var email1=null;var email2=null;var email3=null;var email4=null;(frmObj.email1 != null) ? email1 = frmObj.email1.value : \"\";(frmObj.email2 != null) ? email2 = frmObj.email2.value : \"\";(frmObj.email3 != null) ? email3 = frmObj.email3.value : \"\";(frmObj.email4 != null) ? email4 = frmObj.email4.value : \"\";var count = 0;for ( j=1; j<5; j++ ) {if ( eval(\"email\"+j) != null && eval(\"frmObj.email\"+j).readOnly !=true) {count = 0;if ( eval(\"frmObj.shipEvent\"+j +\" != null && frmObj.shipEvent\"+j +\".checked \") ) {count++;}if ( eval(\"frmObj.exceptionEvent\"+j +\" != null && frmObj.exceptionEvent\"+j +\".checked \") ) {count++;}if ( eval(\"frmObj.deliveryEvent\"+j +\" != null && frmObj.deliveryEvent\"+j +\".checked \") ) {count++;}if ( count == 0 && eval(\"email\"+j).length > 1) {alert(\"Email notifications will NOT be sent unless at least one valid email address AND one event type is selected.\");retVal = false;}}if ( count>0 && eval(\"email\"+j).length == 0) {alert(\"Email notifications will NOT be sent unless at least one valid email address AND one event type is selected.\");retVal = false;}}return retVal;}/*********************************    Email Pin Details**********************************/function submitEmailPinDetails(obj) {if (obj==\"\") return;var formObj = eval(\"document.\" + obj);if (!validate(formObj.fromName.value)) {alert('Invalid characters in the input fields. Please check your entries and try again.');return;} var fromEmail=formObj.fromEmail.value;var toEmail=formObj.toEmail.value;var fromName = formObj.fromName.value;if (fromEmail==\"\" ) {alert('Your email is required. Please enter your email address.');return;}if (toEmail==\"\" ) {alert('\"Email To\" is required. Please enter a To address.');return;}if (fromName==\"\" ) {alert('\"Your Name\" is required. Please enter your name.');return;}if (toEmail!=\"\" && toEmail.indexOf(\"@\")<0) {alert('\"Email To\" address is invalid. Please enter a valid email address.');return;}if (fromEmail!=\"\" && fromEmail.indexOf(\"@\")<0) {alert('\"Your email\" address is invalid. Please enter a valid email address.');return;} formObj.submit();}/*********************************    Authorize Signature Use**********************************/function submitPinAuthorization(obj) {if (obj==\"\") return false;var formObj = eval(\"document.\" + obj);if (!validate(formObj.destFSA.value)) {alert('Invalid characters in the input fields. Please check your entries and try again.');return false;} if (formObj.destFSA.value==\"\" ) {alert('The Postal Code entered is incorrect. Please re-enter the first three characters of the Destination Postal Code and click Submit.');return false;}formObj.destFSA.value = formObj.destFSA.value.toUpperCase();if (!isPostCode(formObj.destFSA.value)){alert('The Postal Code entered is incorrect. Please re-enter the first three characters of the Destination Postal Code and click Submit.');return false;}//formObj.submit();return true;}/*********************************    Multiple Pin get FSA Use**********************************/function submitGetFSA(obj) {if (obj==\"\") return false;var formObj = eval(\"document.\" + obj);if (!validate(formObj.postalCode.value)) {alert('Invalid characters in the input fields. Please check your entries and try again.');return false;} if (formObj.postalCode.value==\"\" ) {alert('The Postal Code entered is incorrect. Please re-enter the Destination Postal Code and click Submit.');return false;}formObj.postalCode.value = formObj.postalCode.value.toUpperCase();if (!isPostCode(formObj.postalCode.value)){alert('The Postal Code entered is incorrect. Please re-enter the Destination Postal Code and click Submit.');return false;}//formObj.submit();return true;}/*********************************    Validate Postal Code**********************************/function isPostCode(entry){strlen = entry.length;//Ignore space in the middleif (entry.charAt(3)==\" \") {entry = entry.substr(0,3) + entry.substr(4,strlen);strlen = entry.length;}if (strlen != 6 && strlen !=3) {return false;}entry=entry.toUpperCase();if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(0)) < 0) {return false;}if ('0123456789'.indexOf(entry.charAt(1)) < 0) {return false;}if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(2)) < 0) {return false;}if (strlen>3) {if ('0123456789'.indexOf(entry.charAt(3)) < 0) {return false;}if ('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(4)) < 0) {return false;}if ('0123456789'.indexOf(entry.charAt(5)) < 0) {return false;}}return true;}/******************************Help*******************************/function zHelp(htype,hid,tar){if (htype==\"\") { htype=\"page\"; }    var url = \"help.do;jsessionid=(camtscpce201_PE1_02)ID1667530950DB01987843102264164735End;saplb_*=(camtscpce201_PE1_02)28006950?action=\" + htype + \"&id=\" + hid;        if (tar==\"self\") {window.location.href=url;} else {if (htype==\"element\") {    var winWidth = 313;    var winHeight = 200;    } else {    var winWidth = 613;    var winHeight = 400;    }    iMyWidth = (window.screen.width/2) - ( ( winWidth / 2 ) + 10 );    iMyHeight = (window.screen.height/2) - ( ( winHeight / 2 ) + 50 );     newWindow = window.open(url, \"_blank\", \"location=no,directories=no,status=no,menubar=no,toolbar=no,scrollbars=1,resizable=yes,height=\" + winHeight + \",width=\" + winWidth + \",left=\" + iMyWidth + \",top=\" + iMyHeight + \",screenX=\" + iMyWidth + \",screenY=\" + iMyHeight );    newWindow.focus();    }}</script><!-- start single --><script language=\"JavaScript\" type=\"text/javascript\" src=\"js/omnitureSupV2.js\"></script><script language=\"javascript\">var origSearchTab = \"\";var pinType = \"Single\";document.getElementById(\"theTitle\").text='Canada Post Corporation - Event Management On-line';</script><!-- package tracking --><div class=\"trakingWrap\">  <h1><img src=\"picture/pool/en/tltTrackapackage.gif\" alt=\"Track a package\"></h1>  <div id=\"content\">  <div style=\"width:100%;\"><div style=\"width:100px;float:left;\"><img src=\"picture/pool/en/tltDetailedItemInfo.gif\" alt=\"Results\" width=\"161\" height=\"22\"></div><div style=\"float:right;\" id=\"backButton\"><a href=\"javascript:history.back();\"><img src=\"picture/pool/en/btnBack_of.gif\" onMouseOver=\"this.src='picture/pool/en/btnBack_ov.gif'\" onMouseOut=\"this.src='picture/pool/en/btnBack_of.gif'\" alt=\"Back\"  height=\"22\" border=\"0\"></a></div><div style=\"float:right;\"><a href=\"javascript:switchScenario('basicPinPool.do;jsessionid=(camtscpce201_PE1_02)ID1667530950DB01987843102264164735End;saplb_*=(camtscpce201_PE1_02)28006950?language=en&curentTab=');\"><img src=\"picture/pool/en/btnSearchAgain_of.gif\" onMouseOver=\"this.src='picture/pool/en/btnSearchAgain_ov.gif'\" onMouseOut=\"this.src='picture/pool/en/btnSearchAgain_of.gif'\" alt=\"Search again\"  height=\"22\" border=\"0\"></a></div></div><br style=\"clear:both;height:1px;\"/><p class=\"pool\"><strong>Item Number</strong>:7146410003169091<br /><strong>Product Type</strong>:Expedited Parcels<br/><strong>Service Standard Delivery Date</strong>:2008/10/03<br/><strong>Reference Number 1</strong>:20579<br/><strong>Reference Number 2</strong>:C</p><!--  START error Section  --><!--  END error Section  --><!--  START Header Section --><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" id=\"tableDetailedItemInformation\"><tr class=\"title\"><th class=\"Headercolumn1\">Date of Event</th><th class=\"Headercolumn1\">Time of Event</th><th class=\"Headercolumn1\">Location</th><th class=\"Headercolumn1\">Description</th><th class=\"Headercolumn1\">Retail Location</th><th class=\"Headercolumn1\">Signatory Name</th></tr><!--  END Header Section --><!--  START Detail Section -->        <tr class=\"\"><td class=\"column1 pool\">2008/10/01</td><td class=\"column2 pool\">15:11</td><td class=\"column3 pool\">STE THERESE DE BLAINVILLE, QC </td><td class=\"column4 pool\">An order has been electronically submitted</td><td class=\"column5 pool\">&nbsp;</td><td class=\"column6 pool\">&nbsp;</td></tr>     </table><!--  END Detail Section -->    <!--  START Link Section -->     </p>       <div class=\"link\"><a class=\"pool\" href=\"emailRequestPool.do;jsessionid=(camtscpce201_PE1_02)ID1667530950DB01987843102264164735End;saplb_*=(camtscpce201_PE1_02)28006950?action=displayRequestForm&pinNumber=7146410003169091&trackingID=7146410003169091&codeSet=PIN&productType=Expedited Parcels&expectedDelvDate=2008/10/03&language=en\">Request Delivery Updates by email</a>&nbsp;<a class=\"pool\" href=\"javascript:omniSetupHelp(s,omniLang,1);zHelp('element','requestEmail','pop')\"><img src=\"picture/pool/btnHelp_of.gif\" onMouseOver=\"this.src='picture/pool/btnHelp_ov.gif'\" onMouseOut=\"this.src='picture/pool/btnHelp_of.gif'\" alt=\"Help\" width=\"19\" height=\"19\" border=\"0\"></a></div><div class=\"link\"><a class=\"pool\" href=\"emailRemovePool.do;jsessionid=(camtscpce201_PE1_02)ID1667530950DB01987843102264164735End;saplb_*=(camtscpce201_PE1_02)28006950?action=displayRemoveForm&pinNumber=7146410003169091&trackingID=7146410003169091&codeSet=PIN&productType=Expedited Parcels&expectedDelvDate=2008/10/03&language=en\">Remove Delivery Updates </a>&nbsp;<a class=\"pool\" href=\"javascript:omniSetupHelp(s,omniLang,1);zHelp('element','removeEmail','pop')\"><img src=\"picture/pool/btnHelp_of.gif\" onMouseOver=\"this.src='picture/pool/btnHelp_ov.gif'\" onMouseOut=\"this.src='picture/pool/btnHelp_of.gif'\" alt=\"Help\" width=\"19\" height=\"19\" border=\"0\"></a></div>   <div class=\"link\"><a class=\"pool\" href=\"emailPagePool.do;jsessionid=(camtscpce201_PE1_02)ID1667530950DB01987843102264164735End;saplb_*=(camtscpce201_PE1_02)28006950?action=displayEmailForm&trackingID=7146410003169091&codeSet=PIN&language=en\" >Email This Page</a>&nbsp;<a class=\"pool\" href=\"javascript:omniSetupHelp(s,omniLang,1);zHelp('element','emailPage','pop')\"><img src=\"picture/pool/btnHelp_of.gif\" onMouseOver=\"this.src='picture/pool/btnHelp_ov.gif'\" onMouseOut=\"this.src='picture/pool/btnHelp_of.gif'\" alt=\"Help\" width=\"19\" height=\"19\" border=\"0\"></a></div>     <center>    <table style=\"border:0px;padding:10px;margin-top:20px;\">      <tr>        <td><p class=\"pool\" style=\"background-image:none;\">Please note that this is the most up to date information available in our system.  Our telephone agents have access to the same information presented here.</p></td>      </tr>      <tr><td>&nbsp;</td></tr>      <tr>        <td><p class=\"pool\" style=\"background-image:none;\">If you need assistance, please contact our <a href=\"https://ssl.postescanada-canadapost.ca/business/corporate/about/contact_us/default-e.asp\" class=\"pool\">Customer Service</a> team.</p></td>      </tr>    </table>    </center>  </div>  <div style=\"clear:both\"></div>  <div id=\"footerTrackingWrap\">&nbsp;</div>  </div>  <br/>  <!-- COMMERCIAL BANNER -->      <h1 align=\"center\"><a href=\"http://www.canadapost.ca/business/intsol/sb/ventureone/default-e.asp?source=tap&icid=bn08000589\" onClick=\"trackBanner('bn08000546');\" target=\"_blank\"><img src=\"picture/pool/en/ventureone.jpg\" border=\"none\" /></a></h1><script>//the following removes the back button if there is no browser history //ex. if page is loaded from an email 'deep link' it will open in a new window that will contain no history//so no back button will be displayed.if ( window.history.length == 0 ) { document.getElementById(\"backButton\").style.display=\"none\";} </script><script language=\"javascript\"><!--omniSetupSingleItemResultFromCPC(s, omniLang);--></script><!-- end single --><!-- start multiple --><!-- Content Ends --><div class=\"noindex\"><!-- END CONTENT --><!-- Third column -->  </td>  <td align=\"left\" valign=\"top\"><img src='https://ssl.postescanada-canadapost.ca/library/images/dot.gif' width=\"16\" height=\"1\" border=\"0\" alt=\"\"></img></td></tr></table><!-- end Second column --></td>  <td width=\"138\" valign=\"top\" bgcolor='white'>  <br/></td></tr></table><!-- End Regular Page --><!-- Footer Area --><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"766\"><tr>  <td>    <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"766\">    <tr>      <td valign=\"top\"><a href=\"http://canada.gc.ca/\" target=\"_blank\"><img src=\"https://ssl.postescanada-canadapost.ca/library/images/template/footerlogo.gif\" width=\"80\" height=\"38\" border=\"0\" alt=\"To Government of Canada website\"></img></a><img src=\"https://ssl.postescanada-canadapost.ca/library/images/template/footermiddle.gif\" width=\"548\" height=\"38\" border=\"0\" alt=\"\"></img></td>      <td rowspan=\"2\" valign=\"top\">      <img src='https://ssl.postescanada-canadapost.ca/library/images/template/border/lightblue/widepagefooterright.gif' width='138' height='56' border='0' alt=\"\"></img>        <!-- <img src='https://ssl.postescanada-canadapost.ca/library/images/template/border/yellow/footerright-e.gif' width='138' height='56' border='0' alt=\"From anywhere to anyone\"></img>-->            </td>    </tr>    <tr>      <td valign=\"top\">        <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=100%>        <tr>          <td><img src=\"https://ssl.postescanada-canadapost.ca/library/images/dot.gif\" width=\"15\" height=\"1\" border=\"0\" alt=\"\"></img></td>                      <td nowrap><a href=\"https://ssl.postescanada-canadapost.ca/common/help/default-e.asp\" class=\"legal pool\">Help</a>,</td>            <td nowrap>&nbsp;<a href=\"https://ssl.postescanada-canadapost.ca/common/help/legal-e.asp\" class=\"legal pool\">Legal</a>,</td>            <td nowrap>&nbsp;<a href=\"https://ssl.postescanada-canadapost.ca/common/help/legal-e.asp#copyright\" class=\"legal pool\">Copyright</a>,</td>            <td nowrap>&nbsp;<a href=\"https://ssl.postescanada-canadapost.ca/common/help/privacy-e.asp\" class=\"legal pool\">Privacy</a>,</td>            <td nowrap>&nbsp;<a href=\"https://ssl.postescanada-canadapost.ca/common/corporate/about/contact_us/default-e.asp\" class=\"legal pool\">Contact Us</a></td>                                 <td nowrap width=100% align=right>&copy; 2006 Canada Post Corporation</td>                     </tr>        </table>      </td>    </tr>    </table>  </td></tr></table><!-- END FOOTER -->  <!-- new textonly link code -->    <!--   <img src=\"https://ssl.postescanada-canadapost.ca/library/images/dot.gif\" width=\"15\" height=1 border=0 alt=\"\"><a href=\"https://ssl.postescanada-canadapost.ca/textonly/tools/pol/bin/search-e.asp\"><span class=\"textstyle\">Text Only</span></a> -->  <!-- SiteCatalyst code version: H.7.Copyright 1997-2006 Omniture, Inc. More info available athttp://www.omniture.com --><script language=\"JavaScript\"><!--/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/var s_code=s.t();if(s_code)document.write(s_code)//--></script><script language=\"JavaScript\"><!--if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\\!-'+'-')//--></script><!--/DO NOT REMOVE/--><!-- End SiteCatalyst code version: H.7. --></div></body></html>"      string


here is the method.

webPageContent = webPageContent.Replace("\r", "").Replace("\n", "").Replace("\t", "");
        Regex pairsRegex = new Regex(@"<strong>(?<name>.*?)</strong>:.*?<b>(?<value>.*?)</b>");
        Regex dateRegex = new Regex(@"Item arrived at postal facility.*<td >(?<submitteddate>[0-9/]*)</td>");

        Match match;

        for (match = pairsRegex.Match(webPageContent); match.Success; match = match.NextMatch()) {
            string name = match.Groups["name"].Value;
            string val = match.Groups["value"].Value;

            // do thing with data
        }

        match = dateRegex.Match(webPageContent);

        if (match.Success) {
            string date = match.Groups["submitteddate"].Value;

            // do date stuff
        }
        return "";

The regExp Is not matching anything.
Did I do something wrong?
0
 
LVL 23

Accepted Solution

by:
Tiggerito earned 500 total points
ID: 22620464
I tested using your original html and all worked fine.

Your new html has a different format so they regex patterns I gave you wont work. e.g. there are no <b> tags!

This would fix your name/value pairs regex:

Regex pairsRegex = new Regex(@"<strong>(?<name>.*?)</strong>:(?<value>.*?)<br");

I can't work out where the date is in your new html, so can't do a regex for that.

Note: this is a problem with scraping. the page is re-designed and your code breaks.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now