I have a Google Spreadsheet where I have the following information on specific cells in the sheet:
http://www.google.com.co/search?q=NASA+watching+now%3A+site%3Awww.youtube.com=IMPORTXML(B1,"//title")Here is the link of the Google spreadsheet - if you want to test from your side.
And here is the Google Spreadsheet I'm working on - which, I want to get the specific data:
h3 HTML tag of the result item).<a> HTML tag of the result item)See screenshot with the data to get using IMPORTXML:

The previous code returns the title of the given URL - in this case, the URL stored in the B1 cell.
It was working without problems (since 12/02/2022 - dd/MM/yyyy) until today (13/02/2022 - dd/mm/yyyy).
I checked the Chrome console "F12 Developer tools" and I get this error:
This document requires 'TrustedScript' assignment.
injectIntoContentWindow @ VM364:27
By clicking the @ VM364:27 line, the following code is shown:
function injectIntoContentWindow(contentWindow)
{
if (contentWindow && !injectedFramesHas(contentWindow))
{
injectedFramesAdd(contentWindow);
try
{
contentWindow[eventName] = checkRequest;
contentWindow.eval( /* ERROR with and (X) is shown here. */
"(" + injectedToString() + ")('" + eventName + "', true);"
);
delete contentWindow[eventName];
}
catch (e) {}
}
}
Searching on the internet, I barely could get the causes of this error:
I've tried:
This document requires 'TrustedScriptURL' assignment message shows.Another possible cause I consider is maybe my IP was blacklisted or blocked, but, I'm not sure.
My browser information:
Is there any way to solve this error in Google Sheets?
PS: I'm interested in know the workaround using google sheets and/or custom scripts - via script editor/Apps Script. The use of IMPORTXML function is not mandatory - I find curious that it was working and then today, not anymore.
I will just leave this here:
=INDEX(UNIQUE(REGEXREPLACE(QUERY(IMPORTXML(A1, "//a/@href"),
"where Col1 contains 'youtube.com/'"), "\/url\?q=|&sa=.*", )))

=IMPORTXML(A1, "//title")

=IMPORTXML(A1, "//h3")

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With