Minggu, 13 Juli 2014

[smf_addin] Digest Number 3118

4 Messages

Digest #3118
1a
Embedded info on GuruFocus by "Jim Ranum" amt2100
1b
Re: Embedded info on GuruFocus by "Randy Harmelink" rharmelink
1c
Re: Embedded info on GuruFocus by "Jim Ranum" amt2100
1d
Re: Embedded info on GuruFocus by "Randy Harmelink" rharmelink

Messages

Sat Jul 12, 2014 8:58 am (PDT) . Posted by:

"Jim Ranum" amt2100

Hi Randy,

I would like to pull Industry Median info for various parameters from
Gurufocus, but have no idea how to do it since it appears on a pop-up
window.

Picture here:

If you go to the stock summary page for any stock on
www.gurufocus.com/stock/esv for example, and hover your mouse over any of
the ratios given, you can see the info.

Is there any way to pull that "2.87" number shown here?

Thanks very much,

Jim

Sat Jul 12, 2014 10:15 am (PDT) . Posted by:

"Randy Harmelink" rharmelink

Yes, it's in a popup window, but all of the popup window definition is
within the source code of the web page. Try this:

=smfConvertData(smfstrExtr(smfGetTagContent("
http://www.gurufocus.com/stock/esv
","td",-1,"id=""ps_indu_tools"""),"Median:","vs"))

On Sat, Jul 12, 2014 at 8:57 AM, 'Jim Ranum' amt2100@... wrote:

>
>
> I would like to pull Industry Median info for various parameters from
> Gurufocus, but have no idea how to do it since it appears on a pop-up
> window.
>
> Picture here:
>
>
>
>
>
> If you go to the stock summary page for any stock on
> www.gurufocus.com/stock/esv for example, and hover your mouse over any
> of the ratios given, you can see the info.
>
> Is there any way to pull that "2.87" number shown here?
>
>
>

Sat Jul 12, 2014 11:39 am (PDT) . Posted by:

"Jim Ranum" amt2100

That is awesome. I gotta tell you, that is pretty cool.

So I see now on the source code for the page that this info is on there. And I see how the "id" is finding the particular metric. So you need to have "Median:","vs" on the end to capture the number in between them? I haven't noticed you doing it that way before. What is the "-1" doing then, in this case?

So I should be able to just replace the "id" and be able to pull any of those other ratios then.

Very helpful, again.

Thanks Randy.

Jim

From: smf_addin@yahoogroups.com [mailto:smf_addin@yahoogroups.com]
Sent: Saturday, July 12, 2014 1:15 PM
To: smf_addin@yahoogroups.com
Subject: Re: [smf_addin] Embedded info on GuruFocus

Yes, it's in a popup window, but all of the popup window definition is within the source code of the web page. Try this:

=smfConvertData(smfstrExtr(smfGetTagContent("http://www.gurufocus.com/stock/esv","td",-1,"id=""ps_indu_tools"""),"Median:","vs"))

On Sat, Jul 12, 2014 at 8:57 AM, 'Jim Ranum' amt2100@... wrote:

I would like to pull Industry Median info for various parameters from Gurufocus, but have no idea how to do it since it appears on a pop-up window.

Picture here:

If you go to the stock summary page for any stock on www.gurufocus.com/stock/esv for example, and hover your mouse over any of the ratios given, you can see the info.

Is there any way to pull that "2.87" number shown here?

Sat Jul 12, 2014 12:15 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

The -1 tells the smfGetTagContent() function to start extraction on the
first <td> tag it finds prior to finding the "id" value. Negative numbers
on RCHGetTableCell() work differently, going from the end of the table row
and going backwards.

And you're correct -- the reason I used that "id" value is because it
should be easy to change to the other ratios. That's often the tricky
part. Finding good search strings to allow consistent extraction of the
data. Most data presentation web pages have a lot of patterns to them,
because of the repetitive nature of displaying data.

I use the smfStrExtr() function a lot when using smfGetTagContent(),
because usually the data needs to be parsed out of the content of the tag.
If you use "~" as the first or last string in smfStrExtr(), it tells it to
start at the beginning of the string, or end at the ending of the string
(since there would be no "strings" to search between when using the
endpoints).

On Sat, Jul 12, 2014 at 11:39 AM, 'Jim Ranum' amt2100@...wrote:

>
> That is awesome. I gotta tell you, that is pretty cool.
>
> So I see now on the source code for the page that this info is on there.
> And I see how the "id" is finding the particular metric. So you need to
> have "Median:","vs" on the end to capture the number in between them? I
> haven't noticed you doing it that way before. What is the "-1" doing then,
> in this case?
>
>
>
> So I should be able to just replace the "id" and be able to pull any of
> those other ratios then.
>
> Very helpful, again.
>
> Thanks Randy.
>
> Jim
>
For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar