0
votes

I am trying to import some data table from http://www.klse.my/stock/entitlement/dividend/7087.jsp#stockDetailDiv and link from http://www.bursamalaysia.com/market/listed-companies/company-announcements/#/?category=EA&company=7087 website to my Google spreadsheet, but Google sheet keep gives me Import Internal Error.

=IMPORTXML("http://www.klse.my/stock/entitlement/dividend/7087.jsp#stockDetailDiv","//*[@id='entitlementTable']/tr[2]/td")    

=IMPORTXML("http://www.bursamalaysia.com/market/listed-companies/company-announcements/#/?category=EA&company=7087","//*[@id='bm_ajax_container']/div/table/tr/td[4]/a/@href")    

I really do not know what causes this problem, but I used to overcome it playing with the xpath query and delete /tbody. This time I couldn't find a xpath query which works.

Does any programming expert know the reason of this error, or how can I make it work? Thanks and Appreciate for help

2

2 Answers

0
votes

Try to use

=IMPORTXML("https://en.wikipedia.org/wiki/Moon_landing"; "//a/@href") (semicolon)
instead
=IMPORTXML("https://en.wikipedia.org/wiki/Moon_landing", "//a/@href")

Official documentation: https://support.google.com/docs/answer/3093342?hl=en

0
votes

this should work - it pulls in the table:

=IMPORTHTML("http://www.klse.my/stock/entitlement/dividend/7087.jsp#stockDetailDiv","table",1)

or also this:

=IMPORTXML("http://www.klse.my/stock/entitlement/dividend/7087.jsp#stockDetailDiv","//tr")

Some of what is causing the difficulty of pulling it in, often is due to jquery being loaded after the page loads - it is dynamic, not static or permanent in the html itself.