Skip to content

Instantly share code, notes, and snippets.

@lapshinmr
Created June 15, 2018 09:59
Show Gist options
  • Select an option

  • Save lapshinmr/60f0e9038515684230904eaf6896e3f0 to your computer and use it in GitHub Desktop.

Select an option

Save lapshinmr/60f0e9038515684230904eaf6896e3f0 to your computer and use it in GitHub Desktop.
element inner html parsing
title = title_el.text or ''
for part in title_el:
title += part.text
title += part.tail or ''
title2 = etree.tostring(title_el, method='text', encoding='utf-8').decode('utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment