Skip to content

Make lxml clean tree available for user modifications#29

Merged
buriy merged 1 commit intoburiy:masterfrom
hush-hush:master
Oct 17, 2012
Merged

Make lxml clean tree available for user modifications#29
buriy merged 1 commit intoburiy:masterfrom
hush-hush:master

Conversation

@hush-hush
Copy link
Copy Markdown

The cleaned lxml object wasn't available outside readability.

It very useful to ask readability to extract and clean an article and then modify the lxml tree before generating a html text stream.

An example to update image link:

d = readability.Document(html)
d.summary(True)
for i in d.html.findall(".//img"):
        # ... some modification ...
summary = d.get_clean_html()

@buriy
Copy link
Copy Markdown
Owner

buriy commented Oct 17, 2012

Applied.

@buriy buriy closed this Oct 17, 2012
@buriy buriy reopened this Oct 17, 2012
buriy added a commit that referenced this pull request Oct 17, 2012
Make lxml clean tree available for user modifications
@buriy buriy merged commit 4e3192f into buriy:master Oct 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants