0

So I'm trying to pull Price/Sales (ttm) for BMRI stocks, and im following the instruction i found in the internet : =importxml(url,xpath)

The url is : https://finance.yahoo.com/quote/BMRI.JK/key-statistics?p=BMRI.JK and i tried taking the xpath using inspect element in my browser and using chrome xpath helper enter image description here

I pasten the XPath in the formula and it resulted in

Error, Result at URL not found

Please advise

Here is the formula I used :

=ImportXML("https://finance.yahoo.com/quote/BMRI.JK/key-statistics?p=BMRI.JK", "//html[@id='atomic']/body[@class='has-scrolled']/div[@id='app']/div/div/div[@id='render-target-default']/div[@class='Bgc($bg-body) Mih(100%) W(100%) Bgc($layoutBgColor)! finance US']/div[@class='Pos(r) Bgc($bg-content) Bgc($lv2BgColor)! Miw(1007px) Maw(1260px) tablet_Miw(600px)--noRightRail Bxz(bb) Bdstartc(t) Bdstartw(20px) Bdendc(t) Bdends(s) Bdendw(20px) Bdstarts(s) Mx(a)']/div[@id='YDC-Col1']/div[@id='Main']/div[@id='Col1-0-KeyStatistics-Proxy']/section[@class='Pb(30px) Px(20px)']/div[@class='Mstart(a) Mend(a)']/div[@class='Fl(start) smartphone_W(100%) W(50%)']/div[@class='Mb(10px) smartphone_Pend(0px) Pend(20px)']/div[@class='Pos(r) Mt(10px)']/div/div/table[@class='W(100%) Bdcl(c) ']/tbody/tr[@class='Bxz(bb) H(36px) BdB Bdbc($seperatorColor) fi-row Bgc($hoverBgColor):h'][5]/td[@class='Fw(500) Ta(end) Pstart(10px) Miw(60px)']")
Rubén
  • 34,714
  • 9
  • 70
  • 166
  • 1
    In your situation, in the current answer, I thought that this answer might lead to an answer. https://stackoverflow.com/a/74872385 In this case, please modify `url` to your URL, and modify `res` to `var res = obj2.QuoteTimeSeriesStore.timeSeries.trailingPsRatio[0].reportedValue.fmt;`. By this, the value of `res` is `4.00`. Is this your expected value? If this is your expected value, I would like to flag this question as a duplicated question. If I misunderstood your expected value, I apologize. But, I thought that this method might be useful for retrieving your expected value. – Tanaike Dec 28 '22 at 12:52

0 Answers0