Answer the question
In order to leave comments, you need to log in
Bring FB2 code back to normal?
There is an XML code for a non-standard FB2 file: (1)
<section>
<p>Глава первая.</p>
</section>
<p>Текст первой главы.</p>
<section>
<p>Глава вторая.</p>
</section>
<p>Текст второй главы.</p>
<section>
<p>Глава первая.</p>
<p>Текст первой главы.</p>
</section>
<section>
<p>Глава вторая.</p>
<p>Текст второй главы.</p>
</section>
from bs4 import BeautifulSoup
bs=BeautifulSoup(xml_code)
for chapter in bs.find_all("section"): chapter.text
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question