Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverse of DOMDeleteTransformer possible? #796

Closed
adesso-thomas-lippitsch opened this issue Aug 24, 2022 · 1 comment
Closed

Inverse of DOMDeleteTransformer possible? #796

adesso-thomas-lippitsch opened this issue Aug 24, 2022 · 1 comment

Comments

@adesso-thomas-lippitsch

Hi,

I am trying to get the inverse functionality of DOMDeleteTransformer.
I want to keep only the content in the specific CSS selector, instead of removing it from the DOM.
I want to get rid of all the text from menus, banners, navigations, etc. and it is easier and more versatile to spcify which content to keep instead of which not to keep.

Is that somehow possible?

I imagined something like a DOMTransformer which can include and exclude parts of the DOM, analogous to the onMatch=[include|exclude] of the ReferenceFilter.

<handler class="DOMTransformer">
    <dom selector="div#content" onMatch="include" />
</handler>
@adesso-thomas-lippitsch
Copy link
Author

This has been solved in How to extract the content of only certain tags using css selector.

Therefor I will close this issue.

Thanks a lot!

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

No branches or pull requests

1 participant