## GitBook

> [GitBook](https://docs.gitbook.com/) is a modern documentation platform where teams can document everything from products to internal knowledge bases and APIs.

This notebook shows how to pull page data from any `GitBook`.

```
from langchain_community.document_loaders import GitbookLoader
```

### Load from single GitBook page[​](#load-from-single-gitbook-page "Direct link to Load from single GitBook page")

```
loader = GitbookLoader("https://docs.gitbook.com")
```

```
page_data = loader.load()
```

```
[Document(page_content='Introduction to GitBook\nGitBook is a modern documentation platform where teams can document everything from products to internal knowledge bases and APIs.\nWe want to help \nteams to work more efficiently\n by creating a simple yet powerful platform for them to \nshare their knowledge\n.\nOur mission is to make a \nuser-friendly\n and \ncollaborative\n product for everyone to create, edit and share knowledge through documentation.\nPublish your documentation in 5 easy steps\nImport\n\nMove your existing content to GitBook with ease.\nGit Sync\n\nBenefit from our bi-directional synchronisation with GitHub and GitLab.\nOrganise your content\n\nCreate pages and spaces and organize them into collections\nCollaborate\n\nInvite other users and collaborate asynchronously with ease.\nPublish your docs\n\nShare your documentation with selected users or with everyone.\nNext\n - Getting started\nOverview\nLast modified \n3mo ago', lookup_str='', metadata={'source': 'https://docs.gitbook.com', 'title': 'Introduction to GitBook'}, lookup_index=0)]
```

### Load from all paths in a given GitBook[​](#load-from-all-paths-in-a-given-gitbook "Direct link to Load from all paths in a given GitBook")

For this to work, the GitbookLoader needs to be initialized with the root path (`https://docs.gitbook.com` in this example) and have `load_all_paths` set to `True`.

```
loader = GitbookLoader("https://docs.gitbook.com", load_all_paths=True)all_pages_data = loader.load()
```

```
Fetching text from https://docs.gitbook.com/Fetching text from https://docs.gitbook.com/getting-started/overviewFetching text from https://docs.gitbook.com/getting-started/importFetching text from https://docs.gitbook.com/getting-started/git-syncFetching text from https://docs.gitbook.com/getting-started/content-structureFetching text from https://docs.gitbook.com/getting-started/collaborationFetching text from https://docs.gitbook.com/getting-started/publishingFetching text from https://docs.gitbook.com/tour/quick-findFetching text from https://docs.gitbook.com/tour/editorFetching text from https://docs.gitbook.com/tour/customizationFetching text from https://docs.gitbook.com/tour/member-managementFetching text from https://docs.gitbook.com/tour/pdf-exportFetching text from https://docs.gitbook.com/tour/activity-historyFetching text from https://docs.gitbook.com/tour/insightsFetching text from https://docs.gitbook.com/tour/notificationsFetching text from https://docs.gitbook.com/tour/internationalizationFetching text from https://docs.gitbook.com/tour/keyboard-shortcutsFetching text from https://docs.gitbook.com/tour/seoFetching text from https://docs.gitbook.com/advanced-guides/custom-domainFetching text from https://docs.gitbook.com/advanced-guides/advanced-sharing-and-securityFetching text from https://docs.gitbook.com/advanced-guides/integrationsFetching text from https://docs.gitbook.com/billing-and-admin/account-settingsFetching text from https://docs.gitbook.com/billing-and-admin/plansFetching text from https://docs.gitbook.com/troubleshooting/faqsFetching text from https://docs.gitbook.com/troubleshooting/hard-refreshFetching text from https://docs.gitbook.com/troubleshooting/report-bugsFetching text from https://docs.gitbook.com/troubleshooting/connectivity-issuesFetching text from https://docs.gitbook.com/troubleshooting/support
```

```
print(f"fetched {len(all_pages_data)} documents.")# show second documentall_pages_data[2]
```

```
Document(page_content="Import\nFind out how to easily migrate your existing documentation and which formats are supported.\nThe import function allows you to migrate and unify existing documentation in GitBook. You can choose to import single or multiple pages although limits apply. \nPermissions\nAll members with editor permission or above can use the import feature.\nSupported formats\nGitBook supports imports from websites or files that are:\nMarkdown (.md or .markdown)\nHTML (.html)\nMicrosoft Word (.docx).\nWe also support import from:\nConfluence\nNotion\nGitHub Wiki\nQuip\nDropbox Paper\nGoogle Docs\nYou can also upload a ZIP\n \ncontaining HTML or Markdown files when \nimporting multiple pages.\nNote: this feature is in beta.\nFeel free to suggest import sources we don't support yet and \nlet us know\n if you have any issues.\nImport panel\nWhen you create a new space, you'll have the option to import content straight away:\nThe new page menu\nImport a page or subpage by selecting \nImport Page\n from the New Page menu, or \nImport Subpage\n in the page action menu, found in the table of contents:\nImport from the page action menu\nWhen you choose your input source, instructions will explain how to proceed.\nAlthough GitBook supports importing content from different kinds of sources, the end result might be different from your source due to differences in product features and document format.\nLimits\nGitBook currently has the following limits for imported content:\nThe maximum number of pages that can be uploaded in a single import is \n20.\nThe maximum number of files (images etc.) that can be uploaded in a single import is \n20.\nGetting started - \nPrevious\nOverview\nNext\n - Getting started\nGit Sync\nLast modified \n4mo ago", lookup_str='', metadata={'source': 'https://docs.gitbook.com/getting-started/import', 'title': 'Import'}, lookup_index=0)
```