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 3485bae commit 00e5754
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
# called "data".
require 'nokogiri'
require 'open-uri'
puts "Ruby version: #{RUBY_VERSION}"

def scrape_calendar_data(year, month)
url = "https://www.sitzungsdienst-schenefeld.de/bi/si010_r.asp?MM=#{month}&YY=#{year}"
document = Nokogiri::HTML(URI.open(url)) # Updated line
document = Nokogiri::HTML(URI.open(url)) # Ensure this line is correct

# Assuming each meeting details are within <tr> tags
document.css('tr').each do |row|
date = row.at_css('td:nth-child(1)').text.strip rescue nil
time = row.at_css('td:nth-child(2)').text.strip rescue nil
Expand All @@ -45,4 +45,3 @@ def scrape_calendar_data(year, month)

# Example: Scrape data for April 2024
scrape_calendar_data(2024, 4)

0 comments on commit 00e5754

Please sign in to comment.