From 3c5945b87e78b0102e9403b15fb2327f656baf5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Sun, 24 Jul 2022 13:20:06 +0100 Subject: [PATCH] Fix FFA page 1 scraping --- promptscrape.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/promptscrape.py b/promptscrape.py index f9f181b..d236b15 100644 --- a/promptscrape.py +++ b/promptscrape.py @@ -140,10 +140,7 @@ ffaprompttext = ffapromptsoup.find(id="comments") ffaresoup = BeautifulSoup(str(ffaprompttext), "html.parser") ffatheprompt = ffaresoup.find_all("h4",text=True) ffacent = [] -for each in ffatheprompt: - if "100 words of" in (str(each.get_text())): - ffacent.append(str(each.get_text())) -i = 2 +i = 1 while i < 8: ffapromptnew = (ffaprompt + "?page=" + str(i) + "&style=light") ffapromptpage = requests.get(ffapromptnew) @@ -153,7 +150,7 @@ while i < 8: ffatheprompt = ffaresoup.find_all("h4",text=True) for each in ffatheprompt: if "100 words of" in (str(each.get_text())) or "100 Words of" in (str(each.get_text())) or "100 Words Of" in (str(each.get_text())): - if "Re:" not in (str(each.get_text())): + if "Re:" not in (str(each.get_text())) and "catch-up" not in (str(each.get_text())): ffacent.append(str(each.get_text())) i += 1 if ffacent: