Top "Lxml" questions

lxml is a full-featured, high performance Python library for processing XML and HTML.

In lxml, how do I remove a tag but retain all contents?

The problem is this: I have an XML fragment like so: <fragment>text1 <a>inner1 </…

python xml lxml
Parsing UTF-8/unicode strings with lxml HTML

I have been trying to parse with etree.HTML() a text encoded as UTF-8 without success. → python Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) […

python parsing unicode utf-8 lxml
How to add a namespace to an attribute in lxml

I'm trying to create an xml entry that looks like this using python and lxml: <resource href="Unit 4.html" …

python xml lxml scorm
lxml will never finish building on ubuntu

I am running ubuntu 14.04 LTS and python 2.7.5 on a vwmare. When I run: sudo pip install lxml I get: Collecting …

python ubuntu lxml
Filtering out certain bytes in python

I'm getting this error in my python program: ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL …

python xml text unicode lxml
Need python lxml syntax help for parsing html

I am brand new to python, and I need some help with the syntax for finding and iterating through html …

python html-parsing lxml
What are the differences between lxml and ElementTree?

When it comes to generating XML data in Python, there are two libraries I often see recommended: lxml and ElementTree …

python lxml elementtree
lxml.etree, element.text doesn't return the entire text from an element

I scrapped some html via xpath, that I then converted into an etree. Something similar to this: <td> …

python xml lxml elementtree xml.etree
python [lxml] - cleaning out html tags

from lxml.html.clean import clean_html, Cleaner def clean(text): try: cleaner = Cleaner(scripts=True, embedded=True, meta=True, …

python parsing lxml
Pretty print in lxml is failing when I add tags to a parsed tree

I have an xml file that I'm using etree from lxml to work with, but when I add tags to …

python xml parsing lxml pretty-print