Jumat, 30 Januari 2015

[smf_addin] Digest Number 3307

2 Messages

Digest #3307
1b
Re: financial times extraction by "Randy Harmelink" rharmelink

Messages

Thu Jan 29, 2015 6:17 am (PST) . Posted by:

tysongayada

Hi randy,

tried using some of the codes stated in the earlier thread to extract financial times data.


for example


=RCHGetHTMLTable("http://markets.ft.com/research/Markets/Tearsheets/Summary?s=GOOG:NSQ","Open",1,"",1) results show 510.00 which is Google price



is there a way to use RCHGETHTMLCELL to extract data such as


1) 52 week range
2) BETA
3) open
4) P/E (TTM)






Thu Jan 29, 2015 7:33 am (PST) . Posted by:

"Randy Harmelink" rharmelink

That's because the string "open" is not a good one to use. The first
occurrence of that string is not in the table, but is part of a URL earlier
on the page:

<script src="//s4.media.ft.com/opentag/opentag-27295-31253.js"></script>

If you want the entire table, you can do:

=RCHGetHTMLTable("
http://markets.ft.com/research/Markets/Tearsheets/Summary?s=GOOG:NSQ
",">Open",-1,"",1)

...or both tables with:

=RCHGetHTMLTable("
http://markets.ft.com/research/Markets/Tearsheets/Summary?s=GOOG:NSQ
",">Open",-1,"",2)

The ">" prefix only works if the web page is written in such a way that the
end of the prior HTML tag is adjacent to the string "Open". You may need to
review the source code of the web page to know how good the search string
is.

For the individual items you mention, try:

=smfConvertData(smfGetTagContent("
http://markets.ft.com/research/Markets/Tearsheets/Summary?s=GOOG:NSQ
","div",1,"lowPriceandDate"))

=smfConvertData(smfGetTagContent("
http://markets.ft.com/research/Markets/Tearsheets/Summary?s=GOOG:NSQ
","div",1,"hiPriceandDate"))

=RCHGetTableCell("
http://markets.ft.com/research/Markets/Tearsheets/Summary?s=GOOG:NSQ
",2,"_volume_magnitude")

=RCHGetTableCell("
http://markets.ft.com/research/Markets/Tearsheets/Summary?s=GOOG:NSQ
",1,">Open")

=RCHGetTableCell("
http://markets.ft.com/research/Markets/Tearsheets/Summary?s=GOOG:NSQ
",1,">P/E")

On Thu, Jan 29, 2015 at 7:17 AM, tysongayada@... wrote:

>
> tried using some of the codes stated in the earlier thread to extract
> financial times data.
>
> for example
>
> =RCHGetHTMLTable("
> http://markets.ft.com/research/Markets/Tearsheets/Summary?s=GOOG:NSQ","Open",1,"",1)
> results show 510.00 which is Google price
>
> is there a way to use RCHGETHTMLCELL to extract data such as
>
> 1) 52 week range
> 2) BETA
> 3) open
> 4) P/E (TTM)
>
For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar