Senin, 03 Februari 2014

[smf_addin] Digest Number 2954[1 Attachment]

9 New Messages

Digest #2954
1a
Re: UK stocks by 5626ab246680da11c468b726d6775461
1b
Re: UK stocks [1 Attachment] by "Randy Harmelink" rharmelink
1c
Re: UK stocks by mikemcq802
1d
Re: UK stocks by "Randy Harmelink" rharmelink
2a
smfStrExtr by wongkayau
2b
Re: smfStrExtr by "Randy Harmelink" rharmelink
2c
Re: smfStrExtr by wongkayau
2d
Re: smfStrExtr by "Randy Harmelink" rharmelink
2e
Re: smfStrExtr by wongkayau

Messages

Sun Feb 2, 2014 4:33 am (PST) . Posted by:

5626ab246680da11c468b726d6775461

Sorry I should be more clear. I download the Excel file with the ISINs etc in them. The only piece missing for each row key in the list is the segment. I need it in order to construct the fourwaykey value which I add as a URL parameter to retrieve the fundamentals page, e.g.


http://www.londonstockexchange.com/exchange/prices/stocks/summary/fundamentals.html?fourWayKey=GB00BCDBXK43GBGBXAIM



I attached the file for your reference.


---In smf_addin@yahoogroups.com, <rharmelink@...> wrote:

If you can't give me direct URL with screening results, you won't be able to give one to the add-in function. And it will need one to know which web page to extract data from.

On Wed, Jan 29, 2014 at 12:02 AM, <stefan.schmidt296@... mailto:stefan.schmidt296@...> wrote:
In the "Search" form at the top select index "FTSE AIM All-Share" for instance and click "Search".






Attachments with this message:
1 of 1 File(s)

Sun Feb 2, 2014 7:09 am (PST) . Posted by:

"Randy Harmelink" rharmelink

I'm still lost as to what it is you're asking the add-in to do?

On Sun, Feb 2, 2014 at 5:33 AM, <stefan.schmidt296@gmail.com> wrote:

> Sorry I should be more clear. I download the Excel file with the ISINs
> etc in them. The only piece missing for each row key in the list is the
> segment. I need it in order to construct the fourwaykey value which I add
> as a URL parameter to retrieve the fundamentals page, e.g.
>
>
> http://www.londonstockexchange.com/exchange/prices/stocks/summary/fundamentals.html?fourWayKey=
> GB00BCDBXK43GBGBXAIM
>
> I attached the file for your reference.
>

Sun Feb 2, 2014 11:23 am (PST) . Posted by:

mikemcq802

I think what he is looking for *should* be found by this:

=smfGetTagContent("http://www.londonstockexchange.com/exchange/searchengine/search.html?lang=en&x=0&y=0&q=AAU#","td",1,"Total Results:","AAU")

However, while I can see the strings in the html text I keep getting "Error" from SMF. I think I've constructed the GetTag properly, I just can't see why it should return "Error".

Once the TD tag value is returned, the full fourWayKey is within that. You would then use string manipulation to extract just the fourWayKey.

As further explanation, his original question said he was looking for what is called "segment" (and which he called "security type" in his spreadsheet) to go with 3 other pieces he already had to form the fourWayKey to perform lookups. See detail page here:
http://www.londonstockexchange.com/exchange/prices-and-markets/stocks/summary/company-summary.html?fourWayKey=GB00B085SD50GBGBXAMSM&lang=en

But, the problem is he needed the fourWayKey to get to that page - a chicken and egg problem.

So, using the above GetTag should retrieve the entire fourWayKey in one go - just given the symbol - in this case AAU. He has the symbols in his first column in his spreadsheet.

Randy, can you see why this GetTag fails? I can see the webpage in Excel Web Query - just keep getting the errors on the GetTag.

Sun Feb 2, 2014 1:29 pm (PST) . Posted by:

"Randy Harmelink" rharmelink

The reason your function is returning error is because you've got the pound
sign in the URL. For whatever reason, the XMLHTTP protocol coughs up when
one of those positional indicators is used. Just drop it and it works fine:

=smfGetTagContent("
http://www.londonstockexchange.com/exchange/searchengine/search.html?q=AAU","td",1,"Total
Results:","AAU")

The fourwaykey extraction is easy:

=smfstrExtr(smfGetTagContent("
http://www.londonstockexchange.com/exchange/searchengine/search.html?q=AAU","td",1,"Total
Results:","AAU"),"fourWayKey=","&")

On Sun, Feb 2, 2014 at 12:23 PM, <mikemcq802@yahoo.com> wrote:

>
> I think what he is looking for *should* be found by this:
>
> =smfGetTagContent("
> http://www.londonstockexchange.com/exchange/searchengine/search.html?lang=en&x=0&y=0&q=AAU#","td",1,"Total
> Results:","AAU")
>
> However, while I can see the strings in the html text I keep getting
> "Error" from SMF. I think I've constructed the GetTag properly, I just
> can't see why it should return "Error".
>
> Once the TD tag value is returned, the full fourWayKey is within that.
> You would then use string manipulation to extract just the fourWayKey.
>
> As further explanation, his original question said he was looking for what
> is called "segment" (and which he called "security type" in his
> spreadsheet) to go with 3 other pieces he already had to form the
> fourWayKey to perform lookups. See detail page here:
>
> http://www.londonstockexchange.com/exchange/prices-and-markets/stocks/summary/company-summary.html?fourWayKey=GB00B085SD50GBGBXAMSM&lang=en
>
> But, the problem is he needed the fourWayKey to get to that page - a
> chicken and egg problem.
>
> So, using the above GetTag should retrieve the entire fourWayKey in one go
> - just given the symbol - in this case AAU. He has the symbols in his
> first column in his spreadsheet.
>
> Randy, can you see why this GetTag fails? I can see the webpage in Excel
> Web Query - just keep getting the errors on the GetTag.
>

Sun Feb 2, 2014 5:08 am (PST) . Posted by:

wongkayau

Hi Randy,

Good morning. Just a quick one on smfStrExtr( Haystack, Start, End ).

How may I just use "start" and leave "end" blanked?
e.g. smfStrExtr("1table2","2",)
I want to get all text on and after t. is it possible to do so?

Thank you so much!

Cheers,
L

Sun Feb 2, 2014 6:58 am (PST) . Posted by:

"Randy Harmelink" rharmelink

As noted in the documentation, you would use a tilda in such a case. For
example:

=smfStrExtr("1table2&quot;,"1","~")

...returns "table2".

Unless I'm not understanding the question?

On Sun, Feb 2, 2014 at 6:08 AM, <wongkayau@yahoo.com> wrote:

> Good morning. Just a quick one on smfStrExtr( Haystack, Start, End ).
>
> How may I just use "start" and leave "end" blanked?
>
> e.g. smfStrExtr("1table2","2",)
>
> I want to get all text on and after t. is it possible to do so?
>

Sun Feb 2, 2014 7:43 am (PST) . Posted by:

wongkayau

thanks Randy. your answer is exactly what I am looking for.

i tried smfStrExtr("1table2","1","2")
..... returning "table".

then i tried your method of smfStrExtr("1table2","1","~")
..... the cell becomes blanked!

may you pls help? thanks a lot.

cheers, L

Sun Feb 2, 2014 8:04 am (PST) . Posted by:

"Randy Harmelink" rharmelink

You probably have an older version of the add-in. What do you get with:

=RCHGetElementNumber("Version&quot;)

On Sun, Feb 2, 2014 at 8:43 AM, <wongkayau@yahoo.com> wrote:

> thanks Randy. your answer is exactly what I am looking for.
>
> i tried smfStrExtr("1table2","1","2")
>
> ..... returning "table".
>
> then i tried your method of smfStrExtr("1table2","1","~")
>
> ..... the cell becomes blanked!
>
> may you pls help? thanks a lot.
>

Sun Feb 2, 2014 8:06 am (PST) . Posted by:

wongkayau

Hi Randy,

I know what happened. My "RCH_Stock_Market_Functions" add-in was old, and I just referred to the combined pdf for reference. Therefore, I don't aware that you have empowered the smf funciton.

Sorry for my absent minded.

I love this smf tool. Thank you so much! Have a good day!

Cheers, L

Tidak ada komentar:

Posting Komentar