extract dates from yahoo finance - please help!

4 views (last 30 days)
Chris
Chris on 24 Dec 2012
I am trying to "scrape" stock data from yahoo finance. Although I am successful in extracting the stock prices, I am having difficulties in extracting the dates. I am using the following command without success:
dateField=regexp(historicalPriceFile, '<td class="yfnc_tabledata1" nowrap align="right">([\d\w-]+)</td>', 'tokens');
Please help!
Thank you in advance,
Chris
  7 Comments
Chris
Chris on 24 Dec 2012
Thanks Walter for the advice, that might work!! I am going to try. It is because Yahoo Finance used to present dates with a "-" and now they changed format.. IN fact I did try "w" with and without "-" but no success..
Thanks!
Chris
Chris on 25 Dec 2012
it does work! thanks a lot!
chris

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 25 Dec 2012
dateField=regexp(historicalPriceFile, '<td class="yfnc_tabledata1" nowrap align="right">([\w\s,]+)</td>', 'tokens');
... as discussed above.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!