Rabu, 22 Juli 2015

[smf_addin] Digest Number 3465[4 Attachments]

10 Messages

Digest #3465

Messages

Tue Jul 21, 2015 5:31 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

Can you give me some examples of ticker symbols that aren't populated? The
three examples you gave me earlier all had values.

The element numbers aren't generally for volatile items like a current
price.

There are other functions you can use. However, if you have a lot of ticker
symbols, data retrieval may be slow. The advantage of the
RCHGetYahooQuotes() function is that you can get multiple data items on up
to 200 ticker symbols with a single Internet access.

The other functions I use quite often are RCHGetTableCell() and
smfGetTagContent(). But when you resort to such web page scraping
functions, you generally need at least one Internet access per ticker
symbol. Even at a quick response time of a half-second per web page, you
can see how quickly elapsed time can climb with hundreds of ticker symbols.
And, even on a fast web site, you'll occasionally run into a 5 to 15 second
delay on a single web page.

The other issue here is finding a good source of the data. I don't use UK
data, so my advice on finding a good data source for them will be next to
useless. :(

On Tue, Jul 21, 2015 at 4:46 PM, robin301249@yahoo.co.uk [smf_addin] <
smf_addin@yahoogroups.com> wrote:

> Right, I am making progress and think I am understanding the basics,
> however, as in your example there are some data elements ((Latest Price -l1
> above) that are not populated in Yahoo Finance.
> Are there any other sources I can use please? I note that this field is
> 'obsolete&#39; in MSN and I cannot see an equivalent field in the
> RCHGetElementNumber-Element-Definitions file provided in the download.
> Any help would be appreciated
>
>

Tue Jul 21, 2015 6:35 pm (PDT) . Posted by:

equalenergy7

Hi Randy,


Still having no luck. I tried


=smfGetTagContent("https://www2.commsec.com.au/Private/MarketPrices/CompanyProfile/Financials.aspx?pID=14Cv2jyfh8PPsGdvTXo0JraCO561e8AloU%2fl6Lzd2GU%3d&stockCode=CTX","span",1,"ctl00_BodyPlaceHolder_FinancialsView1_ctl01_ctl00_ctl01_lblYear01_field")


but it came back with Error.


I have attached files of what a section of the web page looks like, and the source code of the entire page.
I am trying to extract the value of the "Revenues (m)" which starts at source code line 1154. I hope you can access these files without my logon details. Let me know if you need more info.


Regards,
John

Attachment(s) from
2 of 2 File(s)

Tue Jul 21, 2015 7:06 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

Did you log into the website with the EXCEL Web Query dialog? Or with IE?
You will AT LEAST need an IE security cookie to be able to access the site.
But you may need more?

The second file you attached is only 90 bytes long and looks like Chinese
characters of some type...?

On Tue, Jul 21, 2015 at 6:35 PM, equalenergy7@yahoo.com.au [smf_addin] <
smf_addin@yahoogroups.com> wrote:

> [Attachment(s) <#14eb3669f2e43312_TopText> from equalenergy7@yahoo.com.au
> [smf_addin] included below]
>
> Hi Randy,
>
>
> Still having no luck. I tried
>
>
> =smfGetTagContent("
> https://www2.commsec.com.au/Private/MarketPrices/CompanyProfile/Financials.aspx?pID=14Cv2jyfh8PPsGdvTXo0JraCO561e8AloU%2fl6Lzd2GU%3d&stockCode=CTX
> ","span",1,"ctl00_BodyPlaceHolder_FinancialsView1_ctl01_ctl00_ctl01_lblYear01_field")
>
>
> but it came back with Error.
>
>
> I have attached files of what a section of the web page looks like, and
> the source code of the entire page.
>
> I am trying to extract the value of the "Revenues (m)" which starts at
> source code line 1154. I hope you can access these files without my logon
> details. Let me know if you need more info.
>
>
> Regards,
>
> John
>
>
>
>
> Attachment(s) from equalenergy7@yahoo.com.au [smf_addin] | View
> attachments on the web
> <https://groups.yahoo.com/neo/groups/smf_addin/attachments/653478295;_ylc=X3oDMTJyM282MGhvBF9TAzk3MzU5NzE0BGdycElkAzE4MDk0NjIwBGdycHNwSWQDMTcwNTYzMjE5OARzZWMDYXR0YWNobWVudARzbGsDdmlld09uV2ViBHN0aW1lAzE0Mzc1Mjg5MjE->
>
> 2 of 2 File(s)
> Historical Financials.xlsx
> <https://xa.yimg.com/kq/groups/18094620/1962760950/name/Historical%20Financials%2Exlsx>
> CommSec Quotes.htm
> <https://xa.yimg.com/kq/groups/18094620/1224897883/name/CommSec%20%20Quotes%2Ehtm>
>

Tue Jul 21, 2015 10:49 pm (PDT) . Posted by:

equalenergy7

I logged in using IE9. I have a valid logon and password for Commsec. I then copied and pasted the Historical Financials into Excel. I don't know how the other file became corrupt, so I am resending it as a text file.


Regards,
John

Attachment(s) from
1 of 1 File(s)

Tue Jul 21, 2015 11:10 pm (PDT) . Posted by:

equalenergy7

Resending sourcecode.txt 349kB
Attachment(s) from
1 of 1 File(s)

Tue Jul 21, 2015 11:16 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

The attached file had the same content, or at least looked like it.

Can you verify that you're logged in using the EXCEL Web Query process?
Sometimes the IE version EXCEL uses is not the same as the browser...

On Tue, Jul 21, 2015 at 10:49 PM, equalenergy7@yahoo.com.au [smf_addin] <
smf_addin@yahoogroups.com> wrote:

> [Attachment(s) <#14eb44f34a5dab2c_TopText> from equalenergy7@yahoo.com.au
> [smf_addin] included below]
>
> I logged in using IE9. I have a valid logon and password for Commsec. I
> then copied and pasted the Historical Financials into Excel. I don't know
> how the other file became corrupt, so I am resending it as a text file.
>
>
> Regards,
>
> John
>
> Attachment(s) from equalenergy7@yahoo.com.au [smf_addin] | View
> attachments on the web
> <https://groups.yahoo.com/neo/groups/smf_addin/attachments/112425109;_ylc=X3oDMTJyMTVuZWVzBF9TAzk3MzU5NzE0BGdycElkAzE4MDk0NjIwBGdycHNwSWQDMTcwNTYzMjE5OARzZWMDYXR0YWNobWVudARzbGsDdmlld09uV2ViBHN0aW1lAzE0Mzc1NDQxNjQ->
>
> 1 of 1 File(s)
> sourcecode.txt
> <https://xa.yimg.com/kq/groups/18094620/1254628422/name/sourcecode%2Etxt>
> ------------------------------
>
>

Tue Jul 21, 2015 11:17 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

The attached file had the same content, or at least looked like it...

I even looked at it on the Yahoo group instead of using my Gmail app in the
browser. According to Yahoo groups, the attachment had 3 bytes of data...

Here -- take a look at it yourself:

https://groups.yahoo.com/neo/groups/smf_addin/conversations/messages/28839

On Tue, Jul 21, 2015 at 11:10 PM, equalenergy7@yahoo.com.au [smf_addin] <
smf_addin@yahoogroups.com> wrote:

> [Attachment(s) <#14eb462da7bc8352_TopText> from equalenergy7@yahoo.com.au
> [smf_addin] included below]
>
> Resending sourcecode.txt 349kB
>
>
>
> Attachment(s) from equalenergy7@yahoo.com.au [smf_addin] | View
> attachments on the web
> <https://groups.yahoo.com/neo/groups/smf_addin/attachments/1322160999;_ylc=X3oDMTJyYmE2cmZrBF9TAzk3MzU5NzE0BGdycElkAzE4MDk0NjIwBGdycHNwSWQDMTcwNTYzMjE5OARzZWMDYXR0YWNobWVudARzbGsDdmlld09uV2ViBHN0aW1lAzE0Mzc1NDU0NTI->
>
> 1 of 1 File(s)
> sourcecode.txt
> <https://xa.yimg.com/kq/groups/18094620/934764278/name/sourcecode%2Etxt>
>

Tue Jul 21, 2015 11:55 pm (PDT) . Posted by:

equalenergy7

Hi Randy,


After trying to send the HTML source code file again it got clipped down to 3 bytes of Chinese. I couldn't even zip it and send it to you, but I think I had success sending it to <rharmelink@gmail.com> from my gmail account. Hope this helps.


Cheers

Tue Jul 21, 2015 11:59 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

OK. I put the source code you gave me into this web page:

http://ogres-crypt.com/tmp/test.html

It won't be an exact replica because of missing CSS files and JavaScript
type things, but it does appear to have the section you are asking about.
So...

To get the historical financials, you should be able to do either something
like:

=RCHGetHTMLTable("http://ogres-crypt.com/tmp/test.html",">Historical
Financials",-1,"",1)

=RCHGetTableCell("http://ogres-crypt.com/tmp/test.html",1,">Revenues")
=RCHGetTableCell("http://ogres-crypt.com/tmp/test.html",2,">Revenues")
.
.
.

...depending on whether you want to get the whole table at once, or
individual items.

On Tue, Jul 21, 2015 at 11:55 PM, equalenergy7@yahoo.com.au [smf_addin] <
smf_addin@yahoogroups.com> wrote:

> After trying to send the HTML source code file again it got clipped down
> to 3 bytes of Chinese. I couldn't even zip it and send it to you, but I
> think I had success sending it to <rharmelink@gmail.com> from my gmail
> account. Hope this helps.
>

Wed Jul 22, 2015 12:27 am (PDT) . Posted by:

equalenergy7

Thanks Randy. It works a treat !!
For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar