from zipfile import ZipFile from bs4 import BeautifulSoup from lxml import etree with ZipFile('1.fb3') as book: for row in book.read('fb3/body.xml').decode('utf-8').splitlines(): print(row)