'Parses main and sub sections in soup object.
Args:
soup: Soup tag object
Returns:
Section data, containing title, first paragraph and url to content.'

def parse_section(self, soup):

    first_paragraph = self.clean_formatting(soup.findNext('p').get_text())
    title = self.clean_formatting(soup.get_text())
    anchor = self.get_url(soup)
    url = os.path.join(URL_ROOT, self.file_name)
    return {'title': title, 'paragraph': first_paragraph, 'anchor': anchor, 'url': url}
