Home > Enterprise >  Data in Google sheet
Data in Google sheet

Time:05-27

I tried following formula for getting pcr data...

=importxml("https://niftyinvest.com/put-call-ratio/MARUTI?expiry=30JUN2022","//span[@class='white-text red darken-1']"

For different stocks the values are in 3 different colours red/blue/green depending on their values predefined. How to get the common formula so that it can retrieve data in whatever colour plz ????

Other Data Links...

1- enter image description here


for Intraday Pcr:

=INDEX(IMPORTXML(A2, 
 "//span[@class='white-text red darken-1'] | 
  //span[@class='white-text light-blue lighten-1'] |
  //span[@class='white-text green darken-1']"), 2)

enter image description here

CodePudding user response:

Try to use this generic xpath //span[@class[contains(.,'white-text ')]]

=importxml("https://niftyinvest.com/put-call-ratio/MARUTI?expiry=30JUN2022","//span[@class[contains(.,'white-text ')]]")

enter image description here

  • Related