def scrape(): # Run the scrape function and save the results to a variable # @TODO: YOUR CODE HERE! costa_data = scrape_costa.scrape_info() # Update the Mongo database using update and upsert=True # @TODO: YOUR CODE HERE! mongo.db.collection.update({}, costa_data, upsert=True) # Redirect back to home page return redirect("/")
def scrape(): # Run the scrape function costa_data = scrape_costa.scrape_info() # Update the Mongo database using update and upsert=True mongo.db.collection.update({}, costa_data, upsert=True) # Redirect back to home page return redirect("/")
def scrape(): temp_dict = mongo.db.temp_dict dict_data, craig_db = scrape_costa.scrape_info() temp_dict.update({}, dict_data, upsert=True) # 2nd Database Connection mongo2.db.craig.bulk_write( [ReplaceOne({"title": m['title']}, m, upsert=True) for m in craig_db]) return redirect("/", code=302)
def scrape(): # Run the scrape function costa_data = scrape_costa.scrape_info() print(f"costa_data: {costa_data}") # Update the Mongo database using update and upsert=True mongo.db.collection.update_one({}, {"$set": costa_data}, upsert=True) # Redirect back to home page return redirect("/")
def scrape(): # Run the scrape function and save the results to a variable results = scrape_costa.scrape_info() # Update the Mongo database using update and upsert=True destination_data = mongo.db.destination_data page_data = results destination_data.update({}, page_data, upsert=True) # Redirect back to home page return redirect("/")