I am trying to web scrape data from Google Finance, specifically for stock quotes. I am using the answer found here: How to create a stock quote fetching app in python , and its working fine, but only for google. I am new to regex, and noticed what needs to be changed, but not sure how to do it.
The below code works for parsing the data for the google quote to get the current price.
m = re.search('id="ref_694653_l".*?>(.*?)<', content)
the 694653 is specific to google though. If I do Zynga, ZNGA, it should be looking for:
<span id="ref_481720736332929_l">3.57</span>
I want to have a regular expression that searches for
id="ref_SOME_NUMBER_l">SOME_PRICE"
Any help would be greatly appreciated!