Obtaining full HTML of a SPO Site Page programatically

%3CLINGO-SUB%20id%3D%22lingo-sub-260277%22%20slang%3D%22en-US%22%3EObtaining%20full%20HTML%20of%20a%20SPO%20Site%20Page%20programatically%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-260277%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20I%20need%20to%20obtain%20the%20full%20HTML%20of%20a%20SPO%20Site%20Page%20programatically.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20SPFx%20web%20part%20showing%20latest%20published%20site%20pages.%20So%20far%20I%20tried%20with%20%3CSTRONG%3EPNPJS%3C%2FSTRONG%3E%20(ClientSidePage.fromFile)%20with%20%3CSTRONG%3ESearch%3C%2FSTRONG%3E%20(CanvasContent1OWSHTML)%20and%20with%26nbsp%3B%3CSTRONG%3ESP%20REST%20API%3C%2FSTRONG%3E%26nbsp%3B(getbytitle('Site%20Pages')%2FItems%3F%24select%3DCanvasContent1)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20of%20them%20seem%20to%20return%20some%20HTML%20which%20is%20not%20the%20full%20page.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20obtain%20the%20full%20page%20without%20using%20iFrame%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGreeitings%2C%3C%2FP%3E%3CP%3EGeorge%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-260277%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EReact%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESite%20Page%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESPFx%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESPO%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWeb%20Parts%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
New Contributor

Hi I need to obtain the full HTML of a SPO Site Page programatically.

 

I have a SPFx web part showing latest published site pages. So far I tried with PNPJS (ClientSidePage.fromFile) with Search (CanvasContent1OWSHTML) and with SP REST API (getbytitle('Site Pages')/Items?$select=CanvasContent1)

 

All of them seem to return some HTML which is not the full page. 

 

Is there a way to obtain the full page without using iFrame?

 

Greeitings,

George

0 Replies