'Function to scrape
contents of an unordered
list'

def get_ul_contents(self, ulist):

    if (ulist is None):
        return ''
    text = ''
    for li in ulist:
        cur = ''
        for e in li:
            try:
                if (e.name == 'a'):
                    code = e.find('code')
                    if (code is not None):
                        cur += (('<code>' + code.text) + '</code>')
                elif ((e.name == 'div') and ('highlight-default' in e['class'])):
                    cur += (('<pre><code>' + e.text) + '</code></pre>')
                elif (e.name == 'code'):
                    cur += (('<code>' + e.text) + '</code>')
                elif (e.name == 'strong'):
                    cur += str(e)
                elif (e.name == 'p'):
                    cur += self.get_paragraph_contents(e)
            except:
                if (str(type(e)) == "<class    'bs4.element.NavigableString'>"):
                    cur += e.string
        if (cur != ''):
            text += (('<li>' + cur) + '</li>')
    return (('<ul>' + text) + '</ul>')
