I am using WatiN to click links in the browser based on the string i pull off the site.
The problem is that some of the text it pulls is off of multiple lines, so it combines the string into 1 word. example:
“Ultra Corrosion-Resistant Coated Alloy Steel” becomes “Ultra Corrosion-ResistantCoated Alloy Steel”
I am trying to split the string by all capital letters except ones that are hyphenated, so that i can start searching for links by portions of the string.
this is what i have so far
types = doc.DocumentNode.SelectNodes("//h3[@class='AbbrPrsnttn_PrsnttnNm']");
foreach (HtmlNode type in types)
{
desc = type.InnerText.CleanText();
if (browser.Div(Find.ById("ProdPrsnttnGrpCntnr")).Element(Find.ByText(desc)).Exists)
{
browser.Div(Find.ById("ProdPrsnttnGrpCntnr")).Element(Find.ByText(desc)).Click();
System.Threading.Thread.Sleep(5000);
types = doc.DocumentNode.SelectNodes("//h3[@class='AbbrPrsnttn_PrsnttnNm']");
doc2.LoadHtml(browser.Html);
partTable = doc2.DocumentNode.SelectSingleNode("//div[@class='ItmTblGrp']");
MineNext(doc, doc2, browser, typeUrl, types, desc, partTable);
}
else
{
split = desc.Split(new Char[] { ' ' });
}
Here is an example of how it might be achieved:
Updated to also separate numbers.