Rabu, 28 November 2018

[smf_addin] Digest Number 4429

6 Messages

Digest #4429

Messages

Tue Nov 27, 2018 10:27 am (PST) . Posted by:

rcstrauss

Thank you for such a great set of tools for the computer semi-literate. I am trying to retrieve the most recent Ex Date for some cefs from:
https://www.cefconnect.com/fund/ https://www.cefconnect.com/fund/

I am guessing I should use the RCHGetTableCell but I can't figure out the correct syntax. For example, I am trying to get the most recent Ex Date (11/9/2018) returned for
the ticker PDI from cefconnect.com.


Any suggestions would be appreciated


Thanks

Tue Nov 27, 2018 2:48 pm (PST) . Posted by:

"Randy Harmelink" rharmelink

Unfortunately, the data isn't within the source code of the web page, so
there's nothing there you could extract. However, they do use an API to
grab the data from JSON files to populate the web page dynamically. You
could try grabbing the data from there.

The easiest looks like the API for distribution history:

https://www.cefconnect.com/api/v3/distributionhistory/fund/PDI/11-27-2017/11-27-2018

So you'd need to build the URL using the ticker symbol and the dates. This
extraction appears to work:

=smfStrExtr(RCHGetWebData("
https://www.cefconnect.com/api/v3/distributionhistory/fund/PDI/11-27-2017/11-27-2018
","ExDivDateDisplay"),":""","""")

Or, this also appears to work:

=smfGetYahooJSONField("","
https://www.cefconnect.com/api/v3/distributionhistory/fund/PDI/11-27-2017/11-27-2018
","Data.0.ExDivDateDisplay")

On Tue, Nov 27, 2018 at 11:45 AM rcstrauss@yahoo.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:

> Thank you for such a great set of tools for the computer semi-literate. I
> am trying to retrieve the most recent Ex Date for some cefs from:
> https://www.cefconnect.com/fund/
>
> I am guessing I should use the RCHGetTableCell but I can't figure out the
> correct syntax.
> For example, I am trying to get the most recent Ex Date (11/9/2018)
> returned for
> the ticker PDI from cefconnect.com.
>
> Any suggestions would be appreciated
>
>

Tue Nov 27, 2018 4:38 pm (PST) . Posted by:

rcstrauss

That is very helpful, thank you Randy

Tue Nov 27, 2018 10:28 am (PST) . Posted by:

austinportfoliomanager

I'm trying to access analyst earnings estimates for Japanese stocks. I did this with using the line


RCHGetTableCell("https://www.marketwatch.com/investing/stock/"&B11&"/analystestimates?countrycode=jp",3,"Mean Estimate")


Where B11 is the ticker for the stock. It used to work fine for several months and recently quit out on me. I get an error message instead of any data.


This also happens with other RCHGetTableCell requests on marketwatch. The html code on the website looks fine, so I can't figure out what else to check next.


Any suggestions would be appreciated, thank you.

Tue Nov 27, 2018 2:49 pm (PST) . Posted by:

"Randy Harmelink" rharmelink

They've add a "Captcha" to the page to stop access for anything not using
JavaScript. That would include the method being used by the add-in. You can
use the IE object (experimental) method available via the add-in, which
grabs the source code of the web page AFTER it is rendered within IE.
However, I'm not sure how reliable that method is, and it is FAAAAARRR
slower. My requests were taking between 5 and 35 seconds to grab a single
web page.

You didn't give me a sample ticker symbol, so I didn't know what to test
with. But this is the method I used which took a long time per page, using
MMM as the ticker symbol:

=RCHGetTableCell("https://www.marketwatch.com/investing/stock/"&C12&"/analystestimates",3,"Mean
Estimate",,,,,,,,1)

On Tue, Nov 27, 2018 at 11:37 AM andrewoskoui@... wrote:

> I'm trying to access analyst earnings estimates for Japanese stocks. I
> did this with using the line
>
> RCHGetTableCell("https://www.marketwatch.com/investing/stock/"&B11&"/analystestimates?countrycode=jp",3,"Mean
> Estimate")
>
> Where B11 is the ticker for the stock. It used to work fine for several
> months and recently quit out on me. I get an error message instead of any
> data.
>
> This also happens with other RCHGetTableCell requests on marketwatch. The
> html code on the website looks fine, so I can't figure out what else to
> check next.
>
> Any suggestions would be appreciated, thank you.
>

Tue Nov 27, 2018 7:58 pm (PST) . Posted by:

austinportfoliomanager

Thank you for the solution which worked perfectly for me.

I appreciate the effort you put into the addin tool!
For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar