cloudflare / cloudflare/lol-html
How to extract inner HTML of an element?
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 111
- PR merge metrics
- No merged PRs in 30d
Description
Hello!
I'm trying to use lol_html as an HTML parser to extract all content within an element, it's inner HTML. However I haven't figured out the right methods for this yet. Here is what I want to do, given the following HTML snippet:
```
foo
```
I want to extract all the content within the element matching css selector `article#main-content` and store it in a String named `content` after this runs the value of `content` will be equal to:
```
foo
```
I've what would be perfect would be a method on the element called `get_inner_content()` there seems to be all the methods for manipulating the inner content but not actually getting it such as:
`set_inner_content`
`remove_and_keep_content`
Maybe I'm thinking about this wrong, any help just getting the inner content of an element would be so hepful!
Contributor guide
Assessment
This issue has not been assessed yet.