I tried all methods available in the Google Sites API, examples
var site = SitesApp.getSite("example.com", "mysite");
the above method returns an empty array.
And the bellow method returns an error with "Invalid argument: url "
var site = SitesApp.getSiteByUrl("https://sites.google.com/domain/testweb");
How to read a Google Site properly using Google App Script ?
Details:
I own the site and the site is a new Google site NOT a classic one.
As written in the documentation,
A rebuilt version of Sites was launched on November 22, 2016. Apps Script cannot currently access or modify Sites made with this version, but script can still access classic Sites.
So, you cannot access new sites with apps script.
Users who want to access new sites through apps script can add a star(★ on top left) to this feature request to let Google know you're interested and for Google to prioritize the issue.