Web Scraping, Partial match for DataTable column name

Hi, I am querying a finance site for stock prices. Sometimes the column is named “Close” and sometimes it is named “Close*”. How do I access the column values in this case via partial match?

E.g. usually I would use ClosePrice = Convert.ToDouble(SiteRow(“Close”).ToString)

Need this to work even if “Close” is spelled “Close*”

Hi @DEATHFISH

If either “Close” or “Close*” has same index in SiteRow.
You can use SiteRow(indexnumber) to replace SiteRow(“Close”) to make it work even if “Close” is spelled “Close*”.

Hi @wusiyangjia , for versatility purposes I would like it to find by column name, thanks

Hi @DEATHFISH

The second method, when scraping data from web page,
do not immediately extract the whole table,
one by one indicate each column by similar filed,
then you can set a certain name for “Close” or “Close*” column whatever you want.

Hi @wusiyangjia for the purposes of this project I need to extract the full data table

Hi @DEATHFISH

The last way, loop check each column of data table,
And if ColumnName.StartsWith(“Close”) is true, then assign a certain name for future use like below.
SiteDt.Columns.Item(index).ColumnName = “Close”

Is there a method to do this via Regular Expressions or Lambda Expressions?