darknet_diaries_llm/download_transcripts.py

13 lines
373 B
Python
Raw Normal View History

2023-10-06 21:35:53 +02:00
import requests
from bs4 import BeautifulSoup
for i in range(1, 139):
url = f"https://darknetdiaries.com/transcript/{i}"
r = requests.get(url)
soup = BeautifulSoup(r.text, 'html.parser')
pre_section = soup.find('pre')
if pre_section:
text = pre_section.get_text()
with open(f"data/episode_{i}.txt", "w") as f:
f.write(text)