added Dockerfile for container build
This commit is contained in:
6
main.py
6
main.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user