import requests
from bs4 import BeautifulSoup


def scrap_page(slug):
    """
    Scrape the documentation page body text.

    :param slug: Documentation URL slug eg. 'the-lead-page'
    :return: Documentation page body text if it exists
    """
    url = f"https://help.close.com/docs/{slug}"
    response = requests.get(url)
    document = BeautifulSoup(response.text, 'html.parser')
    containers = document.select('#content-container')
    if containers:
        return containers[0].get_text()