"Google Docs encountered an error" on embedded Google Spreadsheet? - google-sheets

I have a web page which embeds several parts of a Google Spreadsheet
http://nkelsey.x10.mx/GTC/Members_Area/WinterSinglesLeague/singlesleaguetablesorig.html
This page has worked for years unaltered. We just edit the spreadsheet and the web pages updates automatically.... only for the last few weeks we have been encountering 'Google Docs encountered an error' messages where the parts of the spreadsheet should be.
I did raise the issue with Google One support but after clarifying the issue after a few hours the report was 'closed' by Google with no response!
I tried making a copy of the spreadsheet and embedding that - again Google Errors were observed.
Does anyone have any idea what is going on?
I have checked the 'Share' on the spreadsheet and it is correctly set to 'View' and the sheet is 'published'. There are no 'hidden' columns or rows.
Thanks in anticipation

Looking at the page source, it appears that the embedded link does not match the spreadsheet. I would suggest trying to replace that link with the one from File > Publish to the web > Embed, carrying over the parameters listed on the Docs Editors help page from the original URL.

Related

Not Infex by Google or Bing.com

My site is https://www.wilfredamaz.com/ In the Google console live test it says "URL is available to Google If it gets indexed and selected as canonical, it could appear in Google Search results with all relevant enhancements. It says further under coverage - Indexed, not submitted in the sitemap. Then it goes on to say - the URL will be indexed only if certain conditions are met from there onwards you must familiar with the Google conditions. It is saying something about "duplicate URL". What does it mean? Is there a solution to solve this problem? Indexing is very much overdue. It was first submitted to Google on the 5th of May and last submitted on the 12th of July. Tried to solve it by adding a code to the htaccess file. Nothing happened. Please help.

importHTML (Google Sheets) formula stopped working

I used the following formula for almost a year now and suddenly it stopped working and is not importing the table.
=IMPORTHTML("https://tradingeconomics.com/matrix";"table";1)
It gives me a "Could not fetch url: https://tradingeconomics.com/matrix error. I also tried the importXML function - same problem.
I tried https://www.octoparse.com just to see if it was able to scrape the data. And it is able to scrape and parse out the data and export it to various formats (you need to install a program for it), although it doesn't solve the problem of automatically importing into Sheet via formula. 😕
Any ideas about what the problem could be and how I need to adapt the formula?
Note: I can't code, unfortunately.
There have being several posts here and other places about the same error message realted to IMPORTHTML. Here are some previous questions bout the same error message that were fixed without making any change:
Google spreadsheet importHTML Could not fetch URL
"Could not fetch URL" using IMPORTHTML
Sometimes the problem is caused by something on the Google side and there isn't any change that can be done on the formula to fix it, the only thing to do is to report the problem to Google from the help menu and wait. At this time the option is shown to me as "Help Sheets improve" but this might change without any notice as it has being done several times.
You might also report it through the official Google Editors Help forum.
Related
How to know if Google Sheets IMPORTDATA, IMPORTFEED, IMPORTHTML or IMPORTXML functions are able to get data from a resource hosted on a website?
try cached version:
https://webcache.googleusercontent.com/search?q=cache:ZNJKOXQm2t4J:https://tradingeconomics.com/matrix+&cd=2&hl=en&ct=clnk
=IMPORTHTML("https://webcache.googleusercontent.com/search?q=cache:https://tradingeconomics.com/matrix", "table", 1)

Importing a website table into Google Spreadsheet

I am trying to import this table into a Google Spreadsheet:
The table is available here:
https://competitions.lta.org.uk/sport/drawsheet.aspx?id=8D598CDE-8579-4541-B7AD-48558BF6FEA3&draw=4
Before Google changed their Spreadsheet addresses, I had the import working with ImportHTML(URL, "table", 2) - but this no longer works, even though there appears to be only two 'table' labels in the page HTML.
Looking for a way to abstract the table, I went to 'importXML' but tried several versions like 'importxml("https://competitions.lta.org.uk/sport/drawsheet.aspx?id=8D598CDE-8579-4541-B7AD-48558BF6FEA3&draw=4", "//div[contains(#id,'poule')]")'
and the same first part of the statement with "//table[contains(#class,'ruler')]")
but the formula fails with 'no content'
Would really appreciate some help to find a way to import this table!
Thanks in anticipation,
The reason you can't get the table data is because of the cookies page
Every time Google Sheets is trying to access that link, you need to accept cookies, and by default, Google Sheets won't do it.
You need to bypass or accept the cookies from the website to access data, you will need to implement more advanced things in Python or Google Apps Script

Google Sheets IMPORTXML XPath - Imported Content is empty [duplicate]

This question already has answers here:
Scraping data to Google Sheets from a website that uses JavaScript
(2 answers)
Closed last month.
I'm attempting to parse the 'PEG Ratio' value of a stock from Yahoo Finance into a Google Sheet, but seeing an error.
URL used: https://finance.yahoo.com/quote/ABBV/key-statistics?p=ABBV
Cell Expression used: =IMPORTXML("http://finance.yahoo.com/quote/ABBV/key-statistics?p=ABBV", "//td[#data-reactid='132']")
Error: '#N/A' value (Error: Imported Content is empty)
Value expected is 1.28 (at the time of posting this query) - from Yahoo Finance > Statistics tab > PEG Ratio table (td has a, attribute data-reactid='132' that I have attempted to filter in the query)
Can anyone help please? Here is a link to the sheet: Google Sheet
Issue
IMPORTXML can only read the HTML source of a website. Therefore, those elements and components of a website added dynamically will not be able to be retrieved by the IMPORTXML and thus IMPORTXML will interpret the tag to be with empty content.
Possible workaround
Sometimes, in the Javascript files of the website, you can find out the URL of the source of data being inserted dynamically but that is a tedious task to achieve.
Other option to get the desired value is to use other web scraping techniques.
I hope this has helped you. Let me know if you need anything else or if you did not understood something. :)
This is probably not what you want, but I was searching around, and found a Google Sheets Add-On that does manage to pull the "1.28" value from that page. It is free for doing a very limited number of queries per month. If interested, search for IMPORTFROMWEB in the GSuite Marketplace.
I only plugged in your URL and the same XPath that you used, so I was very surprised when the data showed up. No idea how it works.
I apologise if mentioning an Add-On is not appropriate on SO. But knowing that an add-on can get that data off the web page may encourage some other ideas on how to do it natively with Sheets.

Old Google Spreadsheet urls became invalid, how to retrieve new urls?

We have a huge collection of spreadsheets with statistical data. There is one "master-sheet" with links to all other sheets. Most of these links have been there for a long time. It seems Google has changed link-formats over time, including id's used to identify the sheets.
Old link format, used often in our master sheet:
http://spreadsheets.google.com/pub?key=rcTO3doih5lvJCjgLSvlajA
Newer link format, used occasionally in our master sheet:
https://docs.google.com/spreadsheet/pub?key=0AkBd6lyS3EmpdDlSTTVWUkU3Z254aEhERmVuQWZaeWc
Newest link format, where Google redirects when you visit a link in the "newer" format: https://docs.google.com/spreadsheets/d/1WipPWXQqXSjj9vPTu1LXD8IxeTfIn4RIBrGaOBd0DXc/pub
Now recently (since a week or so) Google seems to have quit support for the first format. I.e., most of our links are dead, so we can't access our spreadsheets. And we have no way to find out what the new, working, links are.
Does anyone know how to retrieve the spreadsheets when all you have is the old link? We don't have a Google Drive folder with the spreadsheets, so that solution doesn't work.
Thank you so much for any ideas!
You can take the ID of the old link and put it in place of the ID of the newer link (not the newest!), then it will work.
e.g. old link:
http://spreadsheets.google.com/pub?key=rcTO3doih5lvJCjgLSvlajA
Take rcTO3doih5lvJCjgLSvlajA and insert below:
https://docs.google.com/spreadsheet/pub?key=
Results in: https://docs.google.com/spreadsheet/pub?key=rcTO3doih5lvJCjgLSvlajA
You can then follow the redirect to get the newest version of the link

Resources