Office365-REST-Python-Client icon indicating copy to clipboard operation
Office365-REST-Python-Client copied to clipboard

Get html source of sharepoint page?

Open WG- opened this issue 3 years ago • 1 comments

How can I easily fetch the html source code from a sharepoint page?

The snippet below works but I do not manage to get the plain html content?

from office365.runtime.auth.user_credential import UserCredential
from office365.sharepoint.client_context import ClientContext
site_url = "https://company.sharepoint.com/sites/<some site>"
ctx = ClientContext(site_url).with_credentials(UserCredential("[email protected]", "somepassword"))
web = ctx.web
ctx.load(web)
ctx.execute_query()
print(web.properties)
print(ctx.web.get().execute_query())

WG- avatar Mar 30 '22 10:03 WG-

I also have this question. @WG- did you solve it?

henrikruneskog avatar Jul 07 '23 08:07 henrikruneskog