while True:
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36'
}
resp = requests.get(url, headers=headers)
resp.encoding = 'utf-8'
e = etree.HTML(resp.text)
info = ''.join(e.xpath('//div[@id="booktxt"]/p/text()'))
title = e.xpath('//h1/text()')[0]
url = 'https://www.bond-y.com{e.xpath("//a[@rel='next']/@href")[0]}'
with open('1.txt', 'w', encoding='utf-8') as f:
f.write(title + '\n\n' + info + '\n\n')