1

I encounter the error message imported content is empty when I use the formula below in google spreadsheet.

=IMPORTXML("https://www.moh.gov.sg/content/moh_web/home/pressRoom.html", "//div[@class='article highlight']/h3/a/@title")

I am trying to import the list of press release title on the webpage.

What am I doing wrong?

Rubén
  • 34,714
  • 9
  • 70
  • 166
Mike
  • 1,105
  • 3
  • 9
  • 12

1 Answers1

2

So this issue is not your formula or XML in this particular case, its that the content is loaded using jQuery, so you need to figure out where or what the url is that actually holds your content.

Aurielle Perlmann
  • 5,323
  • 1
  • 15
  • 26
  • Thanks. I also just looked at http://stackoverflow.com/questions/20766174/importxml-parse-error. Looks like this may have to involve PhantomJS or something. Do you have an idea how I can parse the javascript generated web content into a google spreadsheet? – Mike Dec 11 '15 at 15:10
  • @MichaelLam I didnt see the exact page the data was being loaded from, but they do offer an RSS feed, from which you can use importfeed like this: `=IMPORTFEED("https://www.moh.gov.sg/content/moh_web/home/rssfeeds/NewsHighlightsRSS/_jcr_content/content/list.feed.html","items title")` – Aurielle Perlmann Dec 13 '15 at 21:17
  • Thanks for the suggestion but I have considered the RSS option and found it not up to date as the URL in my original question. Hence, I was hoping to import the list directly from the URL. – Mike Dec 14 '15 at 01:32