From b80f8664343ceb8dc8026bbdfe3787dd981d1176 Mon Sep 17 00:00:00 2001 From: Karim shoair Date: Sun, 5 Oct 2025 04:04:09 +0300 Subject: [PATCH] docs: update an outdated part --- docs/parsing/main_classes.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/parsing/main_classes.md b/docs/parsing/main_classes.md index ce2c1e8..9d4260d 100644 --- a/docs/parsing/main_classes.md +++ b/docs/parsing/main_classes.md @@ -149,11 +149,6 @@ Get the HTML content of the element >>> article.html_content '

Product 1

\n

This is product 1

\n $10.99\n \n
' ``` -It's the same if you used the `.body` property -```python ->>> article.body -'

Product 1

\n

This is product 1

\n $10.99\n \n
' -``` Get the prettified version of the element's HTML content ```python >>> print(article.prettify()) @@ -163,6 +158,11 @@ Get the prettified version of the element's HTML content ``` +Use `.body` property to get the raw content of page +```python +>>> page.body +'\n \n Some page\n \n \n
\n
\n

Product 1

\n

This is product 1

\n $10.99\n \n
\n\n
\n

Product 2

\n

This is product 2

\n $20.99\n \n
\n\n
\n

Product 3

\n

This is product 3

\n $15.99\n \n
\n
\n\n \n \n' +``` To get all the ancestors in the DOM tree of this element ```python >>> article.path