Home > Software design >  there are two tables on a page, how can i import only one using importxml in google sheets
there are two tables on a page, how can i import only one using importxml in google sheets

Time:01-28

there are two tables on a page, how can I import only one using import XML in google sheets

link https://www.ipowatch.in/p/ipo-subscription-numbers-status.html

I am using =IMPORTXML(H2, "//tr")

where H2 has the link, it's a dynamic table where data changes every day.

But the result is returning two tables whereas I only want upper one.

if I am using =IMPORTXML(H2, "/html/body/div/div[3]/div[2]/div/div[1]/div[2]/div/div/div/div/div[4]/div[1]/div/div/table/tbody")

then its is return all data in a single row

This is my first post on stack overflow, any help would be appreciated

CodePudding user response:

try:

=INDEX(SUBSTITUTE(IMPORTHTML(A1, "table", 1), "*", ))

and for 2nd table:

=INDEX(SUBSTITUTE(IMPORTHTML(A1, "table", 2), "*", ))
  •  Tags:  
  • Related