A web (also called a site) is a SharePoint container for lists, libraries,
and pages. Every site has one root web and optionally many subsites.
Requirement
Description
Reference
Read access to the web
Required to read properties and lists. Site Owner for configuration operations.
SharePoint admin roles
graph TD
Root["Root Web\n(/sites/team)"]
Sub1["Subsite\n(/sites/team/hr)"]
Sub2["Subsite\n(/sites/team/it)"]
List["Lists /\nLibraries"]
SubSub["Sub-subsite\n(/sites/team/hr/benefits)"]
Root --> Sub1
Root --> Sub2
Root --> List
Sub1 --> SubSub
Loading
Every site has a root web. Webs can nest as subsites to form a hierarchy.
The current context's web property represents the site you're connected to.
from office365 .sharepoint .client_context import ClientContext
ctx = ClientContext ("https://contoso.sharepoint.com/sites/team" ).with_client_secret (
"contoso.onmicrosoft.com" , "client_id" , "client_secret"
)
# Get web properties
web = ctx .web .get ().execute_query ()
print (f"Title: { web .title } , URL: { web .url } , Template: { web .get_web_template ()} " )