Bom Bam
Bom Bam

Reputation: 19

How to do web scraping google-sheet for table within <div> by importxml or importhtml?

I'm trying to scrape the data from table on the web page to googlesheet with the following code shown below.

=IMPORTXML("https://backoffice.onlineathome.ondemand.in.th/exams/search", "//div//div[contains(@class, 'rt-tr-group')]")

This shows the inspect element of the table on the web page.

enter image description here

My code dose not work. What is the correct code?

Upvotes: 1

Views: 964

Answers (1)

nabais
nabais

Reputation: 2037

When I try to fetch that URL, the website is redirecting me to their login page:

enter image description here

This means that you are accessing it with your credentials (probably with a authentication cookie on your browser). However, google does not fetch with cookies, so you will not be able to access the data you are trying to access with importhtml nor importxml

Upvotes: 1

Related Questions