Minggu, 01 Desember 2019

[smf_addin] Digest Number 4653

4 Messages

Digest #4653
1a
Re: reuters by wongkayau
1b
Re: reuters by "Randy Harmelink" rharmelink
2a
Re: Yahoo Element numbers by "Randy Harmelink" rharmelink

Messages

Sat Nov 30, 2019 9:48 am (PST) . Posted by:

wongkayau

Hi Randy,


I have just found the way to click the "5 year" button, by using IE:
Dim i As SHDocVw.InternetExplorer
Set i = New InternetExplorer
i.Visible = True
i.navigate "https://www.reuters.wallst.com/reuters/enhancements/US/interactiveChart/chart.asp?symbol=0001.HK"

i.document.getElementsByTagName("li")(79).getElementsByTagName("a")(0).Click


You can see the chart showing 5-year data (vs 3mth in default).


The current problem is that the 5-year data is stored in "https://www.reuters.wallst.com/reuters/enhancements/US/interactiveChart/api.asp", which is a POST request. Do you have any idea to get the data?


Thank you very much.


Cheers,
w

Sat Nov 30, 2019 9:56 am (PST) . Posted by:

"Randy Harmelink" rharmelink

If you're interacting with the IE object, there's all kinds of things you
can do. However, I've never found them to be reliable for data extraction,
which is why I don't utilize them with the add-in. Especially the timing on
waiting for the page to be fully rendered when the web page is being built
dynamically.

IIRC, the "navigate" process has the ability to do it as a POST request,
but I don't think that will help. I think you'll need to create cookies and
other credentials for the "navigate" in order to satisfy that API request.
When I looked at it in Chrome, the CURL request I copied had a lot of
parameters.

Note that doing the 79th "li" tag is not a very reliable way to do it. If
they change the web page and have a different number of list items for
anything prior to that, you'll get the wrong list item.

On Sat, Nov 30, 2019 at 10:48 AM wongkayau@yahoo.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:

>
> I have just found the way to click the "5 year" button, by using IE:
> Dim i As SHDocVw.InternetExplorer
> Set i = New InternetExplorer
> i.Visible = True
> i.navigate "
> https://www.reuters.wallst.com/reuters/enhancements/US/interactiveChart/chart.asp?symbol=0001.HK
> "
>
> i.document.getElementsByTagName("li")(79).getElementsByTagName("a")(0).Click
>
> You can see the chart showing 5-year data (vs 3mth in default).
>
> The current problem is that the 5-year data is stored in "
> https://www.reuters.wallst.com/reuters/enhancements/US/interactiveChart/api.asp",
> which is a POST request. Do you have any idea to get the data?
>
>
>

Sat Nov 30, 2019 9:48 am (PST) . Posted by:

"Randy Harmelink" rharmelink

Check the documentation in the Elements folder on the web site...

On Fri, Nov 29, 2019 at 10:49 PM for30sqn@... wrote:

> I had a list of Yahoo Element Numbers; unfortunately I lost that list.
> Can anyone point me to a spot where I can retrieve it again?
>

Sun Dec 1, 2019 12:48 am (PST) . Posted by:

jsawyermib

Hi Randy, thanks for the response

The first template from: http://ogres-crypt.com/SMF/Templates/#All (SMF-Template-Yahoo-Analyst-Estimates.xls http://ogres-crypt.com/SMF/Templates/SMF-Template-Yahoo-Analyst-Estimates.xls) is accessing estimate data from Yahoo and an example includes


=RCHGetElementNumber(Ticker,644)

Using a ticker such as AMZM returns "$4.23"




The second Template, (smfGetAdvFNElement-Template-All-Line-Items.xls http://ogres-crypt.com/SMF/Templates/smfGetAdvFNElement-Template-All-Line-Items.xls) in cell D8, which used to retrieve historic P&L data


=IF(OR(UPPER(Ticker)="NONE",COLUMNS($D:D)>rPeriods),"--",smfGetADVFNElement(Ticker,rAQ,COLUMNS($D:D),">"&$C8&"<",,"--"))



this no longer returns any data, just "-" (Ticker used AMZN again)




I'm also getting the same result or other templates, such as for the accounts summaries from Morningstar


kind regards


John


















For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar