Skip to content

Commit

Permalink
Update scraper.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
BfB-Schenefeld committed Apr 22, 2024
1 parent 3e3d854 commit f904e2a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def scrape_vorlagen_details(vorlagen_url)
vorlagenprotokolltext = vorlagenprotokolltext_element.text
vorlagenprotokolltext = vorlagenprotokolltext.gsub(/\s+/, ' ').strip # Ersetzt mehrfache Leerzeichen durch ein einzelnes und entfernt führende/anhängende Leerzeichen
vorlagenprotokolltext = vorlagenprotokolltext.gsub(/(?:\r?\n|\r)+/, ' ') # Ersetzt neue Zeilen durch ein Leerzeichen, um Text kompakter zu machen
# Entfernen von Aufdopplungen wie "Beschlussvorschlag ... Beschlussvorschlag"
vorlagenprotokolltext = vorlagenprotokolltext.gsub(/(\b\w+\b)\s*\.\.\.\s*\1/, '\1')
else
vorlagenprotokolltext = "Kein Text im Hauptinhalt gefunden"
end
Expand Down Expand Up @@ -70,3 +72,4 @@ def scrape_vorlagen_details(vorlagen_url)




0 comments on commit f904e2a

Please sign in to comment.