13ze commited on
Commit
c5670b4
·
verified ·
1 Parent(s): a38e938

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -41,7 +41,7 @@ def save_posts_to_csv(posts):
41
  writer = csv.DictWriter(f, fieldnames=['title', 'content', 'featured_image_url', 'category', 'tags'])
42
  writer.writeheader()
43
  writer.writerows(posts)
44
- return "posts.csv"
45
 
46
  def scrape_and_save(csv_file):
47
  posts = scrape_urls(csv_file.name)
@@ -50,8 +50,8 @@ def scrape_and_save(csv_file):
50
 
51
  demo = gr.Interface(
52
  fn=scrape_and_save,
53
- inputs=gr.inputs.File(label="Upload CSV with URLs"),
54
- outputs=gr.outputs.File(label="Download Posts CSV"),
55
  title="Web Scraping to CSV",
56
  description="Upload a CSV file with URLs, and this app will scrape the content and provide a CSV with the results."
57
  )
 
41
  writer = csv.DictWriter(f, fieldnames=['title', 'content', 'featured_image_url', 'category', 'tags'])
42
  writer.writeheader()
43
  writer.writerows(posts)
44
+ return 'posts.csv'
45
 
46
  def scrape_and_save(csv_file):
47
  posts = scrape_urls(csv_file.name)
 
50
 
51
  demo = gr.Interface(
52
  fn=scrape_and_save,
53
+ inputs=gr.File(label="Upload CSV with URLs"),
54
+ outputs=gr.File(label="Download Posts CSV"),
55
  title="Web Scraping to CSV",
56
  description="Upload a CSV file with URLs, and this app will scrape the content and provide a CSV with the results."
57
  )