Google Sheets: Custom Functions only work with published Editor Add-ons? - google-workspace-add-ons

I've been trying to get custom functions working in a Sheets Add-on. However, no matter what I do they won't show up.
Other threads suggest that an add-on must be "published" in order for these functions to show up, but as a public add-on I can't publish until everything is working. (Apparently, it's also not possible to switch this extension to a 'private' one)
So I'm left without a clear approach, unless I'm doing something else that is preventing the custom function from showing. Any suggestions on how to get this fixed?

Related

ImportXML / ImportHTML workaround with URL Tabs on Google Sheets [duplicate]

This question already has answers here:
Scraping data to Google Sheets from a website that uses JavaScript
(2 answers)
Closed last month.
So I am trying to do a spreadsheet using Google Sheets and the importxml/html function. However, I am not seeing a solution for the URL since it has tabs on a persistent URL: https://www.morningstar.co.uk/uk/etf/snapshot/snapshot.aspx?id=0P0001CY2T&tab=3&InvestmentType=FE
My goal is to extract the tables of value & growth but not seeing a way to work around that. Only making it work on the main page of the URL: https://www.morningstar.co.uk/uk/etf/snapshot/snapshot.aspx?id=0P0001CY2T which is data I don't intend to use.
I did try to importhtml with table selection, however not displaying any data when the first URL is used. Also did try importxml with both full Xpath and Xpath for the items I'm interested in and not working either...
Options used:
=importhtml("https://www.morningstar.co.uk/uk/etf/snapshot/snapshot.aspx?id=0P0001CY2T&tab=3&InvestmentType=FE";"table";"2")
=importxml("https://www.morningstar.co.uk/uk/etf/snapshot/snapshot.aspx?id=0P0001CY2T&tab=3&InvestmentType=FE";"//#html/body/div/sal-components-pillar-cards-process/div/div[2]/div/div[3]/div[2]/div/sal-components-mip-style-measures/div/div[3]/div/div[1]/sal-components-mip-measures/div/div[2]/div/div[2]/div/div/div/table/tbody/tr[1]/td[2]")
Any ideas?
It seems that the table you are trying to fetch is controlled by Javascript which is out of hand when using IMPORTs in Google Sheets. Thus, the table can't be scraped.
You can check whether a website/table in a website is javascript controlled by doing this. Go click on the lock button on the left side of the address bar and click site settings, look for Javascript then block it. If you try and reload the website, You should notice a difference before blocking Javascript.
In this case, if you try it on your end, you will notice that after blocking Javascript on the website, you won't be able to see the tables anymore.
IMPORT functions of google sheets are not able to handle JavaScript elements. if you disable JS you are left with (and only this can be imported):

importxml function in Googlesheet

First of all, I'm completely incompetent and my hours-long attempts at trying to make this work have been fruitless. So, please, there's someone that can help me.
I have
table id="..........." tablesorter class="........"
They are in the same line of code ad I'm able to scrape until the first element. For me it's important to scrape by the second one. I'm tryng different way but nothing
investing
In the image, in the part highlighted on the left where there is the drop-down menu, it's possible to select the different American markets (Nasdaq, DowJones,
S&P500 etc.). When I select a market other than DowJones, the URL of the page always remains the same, while the part that I highlighted on the right changes (tablesorter class = "............").
In my sheet, I've done this but it can't allow me to scrape different market (only the default table thay you see when open the webpage)
spreadsheet
Your main problem is that IMPORTXML can only retrieve information from static content in websites. Therefore, any content inserted dynamically can't be retrieved by this function.
In your case, you can check what content is not static by heading over to the website https://it.investing.com/equities/americas and then disabling JavaScript on it. To do so if you are using Chrome please follow this guide.
As Javascript will add dynamic content to the site, when you disable it you will observe that the information subject to change with the dropdown doesn't actually change which means that it was dynamically inserted and therefore can't be accessed by IMPORTXML. I have attached an image below showing this.
As a workaround to this you will need to use other web scraping techniques.

Google sheets IMPORTXML Could not fetch url

I am using IMPORTXML to get information on USPS tracking numbers for my orders and I have been using it for about a month or so, it used to work on and off, sometimes it would not work and all I had to do was either refresh the page or add/remove the "S" on https, and it would work again but it has been about 5 days that it is not working at all no matter what I do, and it is a very tedious task to do manually, external 3rd party tracking apps won't work either because we need everyone to use just the sheet we have because not only contains the tracking info but also everything else. So is there any other way I can import some contents of the USPS tracking website that is reliable and won't stop working, I've seen some scripts here and there but haven't been able to apply them to my needs. Also if that script or workaround could work with other websites like UPS and Fedex it would be awesome as IMPORTXML doesn't work with them (it always says that the content is empty). Thanks in advance.

Google Contacts Dir in Google Sites

I am currently making a Google Site where I would like to embed my contacts. The contacts I am referring to can be found if I log into my gmail account and click on ->Mail->Contacts on the upper left hand corner. Then, on the next page, I click the "Other Contacts" link.
I have tried using a google spreadsheet to read in this data and then displaying that in the Google Site. However, I ran into a few issues. I tried the IMPORTHTML("https://mail.google.com/mail/u/0/#contacts/group/26ae/Other+Contacts","table",1). This didn't return anything. I tried to change the second parameter to 'list' and for the third parameter, I went up to 30 so I doubt that is the issue.
I also tried this approach but no luck. https://www.import.io/post/how-to-get-live-web-data-into-a-spreadsheet-without-ever-leaving-excel/
What would be the best way to resolve this issue of getting those contacts to show up in my site?
I see three options:
Export your contacts to a CSV and import that into a sheet. The downside is that this is not syncing, it is a static update, so maintaining contacts can be problematic.
Use this addon. I have never used it and can offer no advice either way. I believe your domain Admin will need to set it up and I do not think it populates a spreadsheet, so you won't be able to embed your contacts.
Write a custom Google Apps Script. The benefit here is you could use a script to also display the contacts in a clean fashion, with the name as a link, or otherwise. The downside here is you need to write a script. It is javascript based so if you have someone who can do that, it may be your best option. I have done this for a staff directory, which lists all of our domain accounts:

Adding a bar to a bootstrapped firefox extension

I'm trying to develop my first firefox extension and I chose a bootstrapped one, because I can do it easily (not having to install nothing). Now, I'm trying to find at least some documentation to start, and I really need to know how can I add a panel to the browser, something like the history panel, but with some personalized components, as buttons and inputs.
I'm so confused because there are a lot of ways in developing extensions, but I really want to preserve bootstraped method. Any idea how to add the panel or what to read? (I already have read this, and didn't helped https://developer.mozilla.org/es/docs/Extensions/Bootstrapped_extensions )

Resources