Error in getting data in Google Sheets from URL

Viewed 76

Hello I want to get following data (marked in red) from following website.

Image of data I want to get in google sheet

WEBSITE: https://trendlyne.com/equity/PE/NIFTY50/1887/nifty-50/

I tried using importhtml and importxml functions. But they are giving Errors like "could not fetch URL".

For example I used:

=importxml("https://trendlyne.com/equity/PE/NIFTY50/1887/nifty-50/","/html/body/div[3]/div[1]/div[2]/div[2]/div[1]/div")

I am using xPathFinder google chrome plugin to get xPathQuerry.

This method is working for other websites, but not working on this one. Please help. How can I get the data to my excel sheet.

1 Answers

I tested the same method with other websites and it works but I get the same error with the website you're trying to get data from.

The error "Could not fetch url" basically means that Google is not able to import the content from this specific website. This site is rejecting Google's request to prevent web scraping, so this means that IMPORT functions will not work in this scenario.

Related