with contextlib.closing(webdriver.Firefox()) as browser:
    browser.get(url)
content = browser.page_source
cleaner = clean.Cleaner()
content = cleaner.clean_html(content)
with open('/tmp/source.html', 'w') as f:
    f.write(content.encode('utf-8'))
doc = LH.fromstring(content)
with open('/tmp/result.txt', 'w') as f:
    for elt in doc.iterdescendants():
        if elt.tag in ignore_tags:
            continue
text = elt.text or ''
tail = elt.tail or ''
words = ' '.join((text, tail)).strip()
if words:
    words = words.encode('utf-8')
f.write(words + '\n')
Getting all visible text from a webpage using Selenium