0

I have been studying the various IMPORTXML examples posted however I have not been able to solve for the actual data I wish to pull in to my sheet.

The page is here:

https://aemo.com.au/Electricity/National-Electricity-Market-NEM/Data-dashboard#average-price-table

The xpath for the Sept 18 Previous Settlement figure is here (the tbody needs to be removed):

/html/body/div[@id='sfe_result']/div[@id='asx24_result']/div[@id='asx24_result_futures']/table[@class='table-sfe']/tbody/tr[@class='row-alt'][1]/td[@class='price'][7]

The function syntax I have tried amongst others is:

=importxml("https://aemo.com.au/Electricity/National-Electricity-Market-NEM/Data-dashboard#average-price-table","//*[@class='table-sfe']/tr[@class='row-alt'][1]/td[@class='price'][7]")

Any assistance would be very appreciated!

0

IMPORTXML isn't able to get the xPath you are looking for because it isn't on the source code of the referred web page.

Related

  • Ok. So the xpath I obtained using xPath Helper app is pulling it from another web page? Is there another option. – John Hill Sep 4 '18 at 5:15
  • I don't know how the tool you used work. Maybe it gave you the xPath of the parsed HTML instead of the xPath of the source code. Regarding other options checkout webapps.stackexchange.com/tags/importxml/info and en.wikipedia.org/wiki/Web_scraping – Rubén Sep 4 '18 at 12:52
  • Thanks Ruben for your help. I looked at the element in the Chrome dev tools, right clicked and copied the xPath; and it gave me the following for the June22 previous settlement. //*[@id="asx24_result_futures"]/table/tbody/tr[2]/td[11] This is very different to the path given by the xPath Helper app but it still does not work even with the /tbody removed. So the path is on that pages' source code. The HTML element looks like this: <td class="price"> 90.850 </td> So I just need to figure out how to get the "90.850" figure. Thank you again Ruben. Cheers John – John Hill Sep 4 '18 at 23:26
  • Sorry! I pasted the wrong URL in the original question! The correct URL is: asx.com.au/asx/markets/… – John Hill Sep 4 '18 at 23:40
  • @John I think that you should post a new question. – Rubén Sep 5 '18 at 3:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.