@@ -180,28 +180,50 @@ public static string T2M_ETF_Type(string name)
180180 return "Not classified" ;
181181 }
182182
183+
184+ /// <summary>
185+ /// Reads the Exchange list (where available)
186+ /// </summary>
187+ /// <param name="companyPageText"></param>
188+ /// <returns></returns>
183189 public static string T2M_Exchange ( string companyPageText )
184190 {
185- return HelperStringUtils . ClearUTFChars ( input : HelperStringUtils . FindTextBetween (
191+ string likelyExchange = HelperStringUtils . ClearUTFChars ( input : HelperStringUtils . FindTextBetween (
186192 pageText : companyPageText ,
187193 textStart : "Exchange:<dd>" ,
188194 textEnd : "</dd>" ) ) ;
195+
196+ return likelyExchange == "-" || likelyExchange == "n/a" ? string . Empty : likelyExchange ;
189197 }
190198
199+ /// <summary>
200+ /// Reads the Country (where available)
201+ /// </summary>
202+ /// <param name="companyPageText"></param>
203+ /// <returns></returns>
191204 public static string T2M_Country ( string companyPageText )
192205 {
193- return HelperStringUtils . ClearUTFChars ( input : HelperStringUtils . FindTextBetween (
206+ string likelyCountry = HelperStringUtils . ClearUTFChars ( input : HelperStringUtils . FindTextBetween (
194207 pageText : companyPageText ,
195208 textStart : "Country:<dd>" ,
196209 textEnd : "</dd>" ) ) ;
210+
211+ return likelyCountry == "-" || likelyCountry == "n/a" ? string . Empty : likelyCountry ;
197212 }
198213
214+ /// <summary>
215+ /// Reads the Indices [really, index] (where available)
216+ /// </summary>
217+ /// <param name="companyPageText"></param>
218+ /// <returns></returns>
199219 public static string T2M_Indices ( string companyPageText )
200220 {
201- return HelperStringUtils . ClearUTFChars ( input : HelperStringUtils . FindTextBetween (
221+ string likelyIndex = HelperStringUtils . ClearUTFChars ( input : HelperStringUtils . FindTextBetween (
202222 pageText : companyPageText ,
203223 textStart : "Indices:<dd>" ,
204224 textEnd : "</dd>" ) ) ;
225+
226+ return likelyIndex == "-" || likelyIndex == "n/a" ? string . Empty : likelyIndex ;
205227 }
206228
207229 /// <summary>
@@ -497,24 +519,24 @@ public static double T2M_Volume(string pageText)
497519 /// </summary>
498520 /// <param name="pageText"></param>
499521 /// <returns></returns>
500- public static string T2M_Top10_Components ( string pageText )
522+ public static string T2M_Top10_Exposures ( string pageText )
501523 {
502- string top10components = string . Empty ;
503- string likelyComponents = HelperStringUtils . FindTextBetween (
524+ string top10Exposures = string . Empty ;
525+ string likelyExposures = HelperStringUtils . FindTextBetween (
504526 pageText : pageText ,
505527 textStart : "<div id=\" top_10_exposures_data\" >" ,
506528 textEnd : "</div>" ) ;
507- if ( likelyComponents . Contains ( value : "No top ten information is available at this stage" ) )
508- return top10components ;
529+ if ( likelyExposures . Contains ( value : "No top ten information is available at this stage" ) )
530+ return top10Exposures ;
509531
510532 try
511533 {
512- likelyComponents = HelperStringUtils . FindTextBetween (
513- pageText : likelyComponents ,
534+ likelyExposures = HelperStringUtils . FindTextBetween (
535+ pageText : likelyExposures ,
514536 textStart : "<tbody>" ,
515537 textEnd : "</tbody>" ) ;
516538
517- string [ ] lines = likelyComponents . Split ( separator : new [ ] { '\r ' , '\n ' } ,
539+ string [ ] lines = likelyExposures . Split ( separator : new [ ] { '\r ' , '\n ' } ,
518540 options : StringSplitOptions . RemoveEmptyEntries ) ;
519541
520542
@@ -525,15 +547,15 @@ public static string T2M_Top10_Components(string pageText)
525547 // Extract text from the row (remove HTML tags)
526548 string rowText = RemoveHtmlTags ( line : line ) ;
527549
528- top10components += rowText ;
550+ top10Exposures += rowText ;
529551 }
530552 }
531553 catch
532554 {
533555 // nothing
534556 }
535557
536- return top10components ;
558+ return top10Exposures ;
537559
538560 string RemoveHtmlTags ( string line )
539561 {
0 commit comments