added Dockerfile for container build

This commit is contained in:
2024-10-08 13:55:13 -06:00
parent 3d44106f02
commit eecee074e2
2 changed files with 61 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ def scrape_and_generate_rss(url):
page = browser.new_page()
# Set a longer timeout for loading the page
page.set_default_navigation_timeout(60000)
page.set_default_navigation_timeout(120000)
# Load the Warhammer Community page
page.goto(url, wait_until="networkidle")
@@ -98,9 +98,11 @@ def scrape_and_generate_rss(url):
rss_feed = fg.rss_str(pretty=True)
# Save the RSS feed to a file
with open('warhammer_rss_feed.xml', 'wb') as f:
with open('/app/output/warhammer_rss_feed.xml', 'wb') as f:
f.write(rss_feed)
with open('/app/output/page.html','w', encoding='utf-8') as f:
f.write(soup.prettify())
print('RSS feed generated and saved as warhammer_rss_feed.xml')
# Run the function