IMPORTXML returns blank returns #NA (website uses js DataLayer

Viewed 20

I am trying to get data from a website. After trying different approaches I figured the website is using js to render itself so for that reason I am getting no results.

I've used =IMPORTXML("https://website.com/","html") and I got this as a proof:

"function 
gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag(""js"",new 
Date),gtag(""config"",""UA-235635761-1"")function 
gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag(""js"",new 
Date),gtag(""config"",""G-Y8DS8XZ3TZ"")website"

So Google Sheets is getting no results because there is no html or any tags. When I open the page on the browser it loads normally and I can see the tag I am looking for.

Is there any way to overcome this? I was thinking maybe saving the html first in a gdrive folder then using importxml. Any tips?

0 Answers
Related