Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (ozgur, EternallyCurious, howardR, 1 invisible), 623 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
screen scraping upcoming earnings date #473470
07/10/18 20:06
07/10/18 20:06
Joined: May 2018
Posts: 134
S
SBGuy Offline OP
Member
SBGuy  Offline OP
Member
S

Joined: May 2018
Posts: 134
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>...

Re: screen scraping upcoming earnings date [Re: SBGuy] #473480
07/12/18 21:46
07/12/18 21:46
Joined: May 2018
Posts: 134
S
SBGuy Offline OP
Member
SBGuy  Offline OP
Member
S

Joined: May 2018
Posts: 134
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!");

}


Last edited by SBGuy; 07/12/18 21:47.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1