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 2f50972 commit 59560ee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ def scrape_event_details(event_url)
document.css('tr').each do |row|
index_number = row.css('td.tonr a').text.strip rescue ''
betreff = row.css('td.tobetreff div a').text.strip rescue row.css('td.tobetreff div').text.strip
betreff_link = row.at_css('td.tobetreff div a')
betreff_url = betreff_link ? "https://www.sitzungsdienst-schenefeld.de/bi/#{betreff_link['href']}" : "-"
top_link = row.at_css('td.tobetreff div a')
top_url = top_link ? "https://www.sitzungsdienst-schenefeld.de/bi/#{top_link['href']}" : "-"
vorlage_link = row.at_css('td.tovonr a')
vorlage_text = vorlage_link ? vorlage_link.text.strip : "-"
vorlage_url = vorlage_link ? "https://www.sitzungsdienst-schenefeld.de/bi/#{vorlage_link['href']}" : "-"

if !index_number.empty? && !betreff.empty?
event_data << [index_number, betreff, betreff_url, vorlage_text, vorlage_url]
puts "Gefunden: #{index_number}, Betreff: #{betreff}, Betreff URL: #{betreff_url}, Vorlage: #{vorlage_text}, Vorlage URL: #{vorlage_url}"
event_data << [index_number, betreff, top_url, vorlage_text, vorlage_url]
puts "Gefunden: #{index_number}, Betreff: #{betreff}, TOP-URL: #{top_url}, Vorlage: #{vorlage_text}, Vorlage URL: #{vorlage_url}"
end
end
return event_data
Expand All @@ -60,3 +60,4 @@ def scrape_event_details(event_url)




0 comments on commit 59560ee

Please sign in to comment.