Gamestudio Links
Zorro Links
Newest Posts
Windows permission issues
by HellThunder
Yesterday at 21:51
CSVToHistory.c
by Dalla
Yesterday at 20:42
Position Close not possible
by MatPed
Yesterday at 18:49
Options trading questions
by Zheka
Yesterday at 17:36
Published Gamestudio Games?
by jumpman
Yesterday at 08:05
New Zorro version 1.88
by DdlV
09/24/18 20:32
Possible to extend assetHistory with own source?
by jcl
09/24/18 16:32
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
15 registered (Jason_Rogers, alibaba, dmac, AndrewAMD, HellThunder, StefanS, Dalla, jumpman, 3 invisible), 504 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
cepturion, Mon3y, vincitytaymo, just, XJohnny_Hoffmann
18057 Registered Users
Topic Options
Rate This Topic
#473470 - 07/10/18 22:06 screen scraping upcoming earnings date
SBGuy Offline
Newbie

Registered: 05/27/18
Posts: 49
I'm a little rusty with string parsing. Hope one of gurus can help. I'm trying to scrape the upcoming earnings date from a Yahoo Finance quote page and it's not working.

See code below and sample of the text snipet I'm trying to parse.

Thanks!

Code:
void main()
{
    string eDate[50];
    string Content = http_transfer("https://finance.yahoo.com/quote/AAPL",0);
    sscanf(Content,"<span data-reactid="102">%s<",eDate);
    printf("n%s...Done!",eDate);

}




...<span data-reactid="100">Earnings Date</span></td><td class="Ta(end) Fw(b) Lh(14px)" data-test="EARNINGS_DATE-value" data-reactid="101"><span data-reactid="102">Jul 31, 2018</span>...

Top
#473480 - 07/12/18 23:46 Re: screen scraping upcoming earnings date [Re: SBGuy]
SBGuy Offline
Newbie

Registered: 05/27/18
Posts: 49
after a couple days of slogging here is a solution, if anyone is interested.

Code:
void main()
{
	
	string Content = http_transfer("https://finance.yahoo.com/quote/AAPL",0);
	string s = strstr(strstr(Content," data-reactid="102">"),">");

	var EarningsDate = wdatef("%b %d, %Y",strtok(s+1,"<"));
		
	printf("n..%.0f....",EarningsDate);

	printf("n..%d....",ymd(EarningsDate));

	printf("n...done!");

}



Edited by SBGuy (07/12/18 23:47)

Top



Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de