def scrape(): mars = collection mars_results = scrape_mars.scraper() mars.update({}, mars_results, upsert=True) return redirect("/", code=302)
def scrape(): data = scraper() collection.update({}, data, upsert=True) return redirect("/", code=302)
def scraper(): mars_data = mongo.db.mars_data # Run the scrape function marsdata = scrape_mars.scraper() # Update the Mongo database using update and upsert=True mars_data.update({}, marsdata, upsert=True) return redirect("/", code=302)
def scrape(): # Run the scrape function mars_data = scrape_mars.scraper() # Update the Mongo database using update and upsert=True mongo.db.collection.update({}, mars_data, upsert=True) # Redirect back to home page return redirect("/")
def scraper(): # Run scraped functions mars = scrape_mars.scraper() # Store results into dictionary mars_dict = { "latest_news": mars["latest_news"], "latest_paragraph": mars["latest_paragraph"], "featured_image_url": mars["featured_image_url"], "mars_weather": mars["mars_weather"], "mars_table": mars["mars_table"], "hemi_dicts": mars["hemi_dicts"] } # Insert mars_dict into database mongo.db.collection.insert_one(mars_dict) # Redirect back to home page return redirect("http://localhost:5000/", code=302)
def scrape(): data = scrape_mars.scraper() mongo.db.scrapped_info.update({}, data, upsert = True) return redirect("/")
def scrape(): mars_data_scrape = scrape_mars.scraper() mongo.db.mars_info.update({}, mars_data_scrape, upsert=True) return redirect('/')
def scraper_M(): Mars_dict = mongo.db.Mars_dict Mars_dict_data = scrape_mars.scraper() Mars_dict.update({}, Mars_dict_data, upsert=True) return redirect("/", code=302)
def scrape(): mars = mongo.db.mars.update({}, scraper(), upsert=True) return redirect("/")
def scraper(): mongo.db.mars_data.drop() data_scraped = scrape_mars.scraper() mongo.db.mars_data.insert_one(data_scraped) return redirect("/", code=302)
def scraperMars(): mars = mongo.db.mars mars_data = scraper() mars.update({}, mars_data, upsert=True) return redirect("/", code=302)