Hi ! I am currently designing my own stock excel/google sheets but I can't seem to find a way to pull KLSE data into it. Is there any way for me to proceed?
Thanks
Stock Spreadsheet
Stock Spreadsheet
|
|
Mar 2 2020, 02:31 AM, updated 6y ago
Show posts by this member only | Post
#1
|
![]() ![]()
Junior Member
64 posts Joined: Apr 2011 |
Hi ! I am currently designing my own stock excel/google sheets but I can't seem to find a way to pull KLSE data into it. Is there any way for me to proceed?
Thanks |
|
|
|
|
|
Mar 2 2020, 09:07 AM
Show posts by this member only | Post
#2
|
![]() ![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
2,210 posts Joined: Jan 2018 |
QUOTE(97fangkhai97 @ Mar 2 2020, 02:31 AM) Hi ! I am currently designing my own stock excel/google sheets but I can't seem to find a way to pull KLSE data into it. Is there any way for me to proceed? I think it's not possible to obtain data on Google Sheets using Google Finance formula because it is not supported.You might be able to if you have a paid database and use an add-on. On Excel, it is possible to pull data from websites. Example here. So you may be able to pull from websites that has Malaysian closing price. Example of pulling from klse.i3investor.com ![]() ![]() Do note that most websites do not give live rates and are often delayed. Therefore, it's not useful for daily trading. |
|
|
Mar 3 2020, 08:37 PM
Show posts by this member only | IPv6 | Post
#3
|
![]() ![]() ![]()
Junior Member
499 posts Joined: Dec 2007 |
QUOTE(Yggdrasil @ Mar 2 2020, 09:07 AM) I think it's not possible to obtain data on Google Sheets using Google Finance formula because it is not supported. I just tried using =importxml in google sheet, it works! You might be able to if you have a paid database and use an add-on. On Excel, it is possible to pull data from websites. Example here. So you may be able to pull from websites that has Malaysian closing price. Example of pulling from klse.i3investor.com ![]() ![]() Do note that most websites do not give live rates and are often delayed. Therefore, it's not useful for daily trading. But I choose to scrape the price from Bloomberg instead, just a personal preference. Google limit the formula auto update in sheet at once per hour interval if use too many of the formula in one sheet, so not suitable for day trading too. Though it’s great to have the sheet as a tracker to check at night after work |
|
|
Mar 3 2020, 10:02 PM
Show posts by this member only | Post
#4
|
![]() ![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
2,210 posts Joined: Jan 2018 |
QUOTE(Intimidated @ Mar 3 2020, 08:37 PM) I just tried using =importxml in google sheet, it works! Thanks for sharing. But how do you get the Xpath? But I choose to scrape the price from Bloomberg instead, just a personal preference. Google limit the formula auto update in sheet at once per hour interval if use too many of the formula in one sheet, so not suitable for day trading too. Though it’s great to have the sheet as a tracker to check at night after work I tried but I got an error. ![]() Took the Xpath from here. There's Xpath and full Xpath ![]() |
|
|
Mar 3 2020, 10:15 PM
Show posts by this member only | IPv6 | Post
#5
|
![]() ![]() ![]()
Junior Member
499 posts Joined: Dec 2007 |
QUOTE(Yggdrasil @ Mar 3 2020, 10:02 PM) Thanks for sharing. But how do you get the Xpath? I did this I tried but I got an error. ![]() Took the Xpath from here. There's Xpath and full Xpath ![]() CODE =importxml(D7,"//span[@class='priceText__1853e8a5']") D7 = the cell that I put the Bloomberg url Then I get a column of the url I want to track, and copy paste the =importxml formula This post has been edited by Intimidated: Mar 3 2020, 10:17 PM |
|
|
Mar 3 2020, 10:21 PM
Show posts by this member only | Post
#6
|
![]() ![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
2,210 posts Joined: Jan 2018 |
QUOTE(Intimidated @ Mar 3 2020, 10:15 PM) I did this Nice! But do you know how to get the code? So can use for other websites too CODE =importxml(D7,"//span[@class='priceText__1853e8a5']") D7 = the cell that I put the Bloomberg url Then I get a column of the url I want to track, and copy paste the =importxml formula Edit: Wait. I think the picture I posted has the answer lol. Edit 2: Oops doesn't work. Ah well. This post has been edited by Yggdrasil: Mar 3 2020, 10:28 PM |
|
|
|
|
|
Mar 3 2020, 10:26 PM
Show posts by this member only | IPv6 | Post
#7
|
![]() ![]() ![]()
Junior Member
499 posts Joined: Dec 2007 |
QUOTE(Yggdrasil @ Mar 3 2020, 10:21 PM) Nice! But do you know how to get the code? So can use for other websites too Ya ya i think the formula only works with things likeEdit: Wait. I think the picture I posted has the answer lol. CODE //td[@somethingsomething] //a[@somethingsomething] //span[@somethingsomething] I also trial and error lol This post has been edited by Intimidated: Mar 3 2020, 10:26 PM |
|
|
Mar 3 2020, 10:39 PM
Show posts by this member only | Post
#8
|
![]() ![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
2,210 posts Joined: Jan 2018 |
QUOTE(Intimidated @ Mar 3 2020, 10:26 PM) Ya ya i think the formula only works with things like I think I found it. For example, klse.i3investor.comCODE //td[@somethingsomething] //a[@somethingsomething] //span[@somethingsomething] I also trial and error lol ![]() 1. Input the formula like usual: =importxml("https://klse.i3investor.com/servlets/stk/annrep/6084.jsp", 2. Use inspect element to highlight the data. As you can see, the code starts with "td". So, CODE //td[@ 3. 0.38 which is the data we need is next to "class", so CODE //td[@class=' 4. Fill in with the remaining code. So, CODE //td[@class='down big16'] 5. Final code: CODE =importxml("https://klse.i3investor.com/servlets/stk/annrep/6084.jsp","//td[@class='down big16']") 6. Results ![]() |
|
|
Mar 3 2020, 10:43 PM
Show posts by this member only | IPv6 | Post
#9
|
![]() ![]() ![]()
Junior Member
499 posts Joined: Dec 2007 |
QUOTE(Yggdrasil @ Mar 3 2020, 10:39 PM) I think I found it. For example, klse.i3investor.com Oh I just tried on a stock that gained instead of loss![]() 1. Input the formula like usual: =importxml("https://klse.i3investor.com/servlets/stk/annrep/6084.jsp", 2. Use inspect element to highlight the data. As you can see, the code starts with "td". So, CODE //td[@ 3. 0.38 which is the data we need is next to "class", so CODE //td[@class=' 4. Fill in with the remaining code. So, CODE //td[@class='down big16'] 5. Final code: CODE =importxml("https://klse.i3investor.com/servlets/stk/annrep/6084.jsp","//td[@class='down big16']") 6. Results ![]() The class will be ‘up big16’ instead So maybe can do like IFERROR(importxml_with_up big16, importxml_with_down big16) |
|
|
Mar 3 2020, 10:44 PM
|
![]() ![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
2,210 posts Joined: Jan 2018 |
|
|
|
Mar 4 2020, 02:15 PM
|
![]() ![]() ![]() ![]()
Junior Member
513 posts Joined: Dec 2006 |
Mine still have error of #NAME?
Any idea how to solve it ? |
|
|
Mar 4 2020, 02:18 PM
|
![]() ![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
2,210 posts Joined: Jan 2018 |
|
|
|
Mar 4 2020, 02:23 PM
|
![]() ![]() ![]() ![]()
Junior Member
513 posts Joined: Dec 2006 |
|
|
|
|
|
|
Mar 4 2020, 02:35 PM
|
![]() ![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
2,210 posts Joined: Jan 2018 |
QUOTE(bmwcaddy @ Mar 4 2020, 02:23 PM) SUNREIT, from KLSE i3investor Hmm. klse.i3investor.com code is unstable as it changes everytime.=importxml("https://klse.i3investor.com/servlets/stk/5176.jsp","//tdclass='up big16'") Use Bloomberg instead. E.g. for Sunreit: CODE =importxml("https://www.bloomberg.com/quote/SREIT:MK","//span[@class='priceText__1853e8a5']") |
|
|
Mar 4 2020, 02:38 PM
|
![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
1,081 posts Joined: Aug 2018 |
QUOTE(97fangkhai97 @ Mar 2 2020, 02:31 AM) Hi ! I am currently designing my own stock excel/google sheets but I can't seem to find a way to pull KLSE data into it. Is there any way for me to proceed? Why need to use excel? Plenty of established free or by subscription tool available. You want to be successful or just having fancy excel sheet is the goal?Thanks |
|
|
Mar 4 2020, 02:46 PM
|
![]() ![]() ![]() ![]()
Junior Member
513 posts Joined: Dec 2006 |
QUOTE(Yggdrasil @ Mar 4 2020, 02:35 PM) Hmm. klse.i3investor.com code is unstable as it changes everytime. Still the same problem wor. Am i missing out anything? need to enable any developer tools etc. ? I just copied your code into my excel formula then #NAME?Use Bloomberg instead. E.g. for Sunreit: CODE =importxml("https://www.bloomberg.com/quote/SREIT:MK","//span[@class='priceText__1853e8a5']") |
|
|
Mar 4 2020, 02:50 PM
|
![]() ![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
2,210 posts Joined: Jan 2018 |
|
|
|
Mar 4 2020, 02:58 PM
|
![]() ![]() ![]() ![]()
Junior Member
513 posts Joined: Dec 2006 |
|
|
|
Mar 4 2020, 03:04 PM
|
![]() ![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
2,210 posts Joined: Jan 2018 |
QUOTE(bmwcaddy @ Mar 4 2020, 02:46 PM) Still the same problem wor. Am i missing out anything? need to enable any developer tools etc. ? I just copied your code into my excel formula then #NAME? bmwcaddyRough guide how to get the data. Clean up later if you want. Excel 1. Copy URL. ![]() 2. In Excel, go to Data. ![]() 3. Paste link. ![]() 4. Navigate to the info you want. Easy way is to just import the whole table and hide the sheet we don't want. Click load. ![]() 5. It will appear like this. ![]() 6. Clean up if you want. My putting a master sheet with what you want to see and the other data in another sheet like this. ![]() 7. Click refresh all when you want to get latest data. ![]() |
|
|
Mar 4 2020, 03:13 PM
|
![]() ![]() ![]() ![]()
Junior Member
513 posts Joined: Dec 2006 |
QUOTE(Yggdrasil @ Mar 4 2020, 03:04 PM) bmwcaddy Thanks for the detailed steps. But my problem seems to be stuck at step 2: My excel 2016 cant run the script (error running) of the website, causing it to crash whenever i past any web linkRough guide how to get the data. Clean up later if you want. Excel 1. Copy URL. ![]() 2. In Excel, go to Data. ![]() 3. Paste link. ![]() 4. Navigate to the info you want. Easy way is to just import the whole table and hide the sheet we don't want. Click load. ![]() 5. It will appear like this. ![]() 6. Clean up if you want. My putting a master sheet with what you want to see and the other data in another sheet like this. ![]() 7. Click refresh all when you want to get latest data. ![]() |
| Change to: | 0.0222sec
0.37
6 queries
GZIP Disabled
Time is now: 21st December 2025 - 08:13 AM |