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 21, 2024
1 parent 129738d commit 1c171fe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ def scrape_calendar_data(year, month)
url = "https://www.sitzungsdienst-schenefeld.de/bi/si010_r.asp?MM=#{month}&YY=#{year}"
document = Nokogiri::HTML(open(url))

date_link = document.at_css('span#sidatum a')['href']
scrape_details(date_link) if date_link
date_link_element = document.at_css('span#sidatum a')
if date_link_element && date_link_element['href']
scrape_details(date_link_element['href'])
else
puts "Kein Datum-Link gefunden oder 'href'-Attribut fehlt."
end
end

# Beispiel: Daten für März 2024 scrapen
Expand Down

0 comments on commit 1c171fe

Please sign in to comment.