def launch(): db.mars.drop() mars_dict = scrape() db.mars.insert_one(mars_dict) mars_page = db.mars.find_one() # Return the template with the teams list passed in return render_template('index.html', mars=mars_page)
def scrape(): mars = mongo.db.mars mars_data = scrape_mars.scrape() mars.update( {}, mars_info, upsert=True ) return redirect("http://localhost:5000/", code=302)
def scrape(): # Run scraped functions mars_info = scrape_mars.scrape() print(mars_info) #store results in dictionary (stored in scrape_mars.py file) # Insert Mars info into database mongo.db.mars.insert_one(mars_info) # Redirect back to home page return redirect("http://localhost:5000/", code=302)
def index(): scrape_mars.scrape() return render_template("scraping.html")
def scrape(): # db.collection.remove() mars = scrape_mars.scrape() print("\n\n\n") db.marsfacts.update({}, mars, upsert=True) return render_template("index.html", mars = mars)
def scrape(): mars_info = db.mars mars_data = scrape_mars.scrape() collection.update({}, mars_data, upsert=True) return redirect("/", code=302)
def scraper(): mars_data=scrape_mars.scrape() # scrape_result.insert_many(mars_data) scrape_result.update({}, mars_data, upsert=True) return redirect("/")
def scraper(): mars_data = scrape_mars.scrape() mongo.db.collection.update({}, mars_data, upsert=True) return redirect("/", code=302)
def scrapper(): mars = mongo.db.mars mars_data = scrape_mars.scrape() mars.update({}, mars_data) return "Scrape Successful"
def scraper(): mars_db = db.mars_db mars_data = scrape_mars.scrape() mars_db.update({}, mars_data, upsert=True) return redirect('/')
def scraper(): mars_stuff = mongo.db.mars_stuff mars_stuff_data = scrape_mars.scrape() mars_stuff.update({}, mars_stuff_data, upsert=True) return redirect("/", code=302)
def scrape(): scrape_mars.scrape() return redirect('/', code=302)
def scrape(): storing_dict = mongo.db.storing_dict storing_dict_data = scrape_mars.scrape() storing_dict.update({}, storing_dict_data, upsert=True) return redirect("/", code=302)
def scrape(): mars_info = mongo.db.mars_info mars_data = scrape_mars.scrape() mars_info.update({}, mars_data, upsert=True) return redirect("http://localhost:5000/", code=302)
def scraper(): mars = mongo.db.mars mars_data = scrape_mars.scrape() mars.replace_one({}, mars_data, upsert=True) return redirect('/')
def scrape(): mars = mongo.db.mars mars_data = scrape_mars.scrape() return redirect("/", code=302)
def scrape(): mars = client.db.mars mars_scraping = scrape_mars.scrape() mars.update({}, mars_scraping, upsert=True) return redirect("/", code=302)
def scrape(): mars = client.db.mars mars_data = scrape_mars.scrape() mars.update({}, mars_data) return "Scraped!"
def scrape(): mission_to_mars = mongo.db.mission_to_mars mission_to_mars_data = scrape_mars.scrape() mission_to_mars.update({}, mission_to_mars_data, upsert=True) return redirect("/", code=302)
def data(): mars_info=scrape() mongo.db.collection.update({},mars_info,upsert=True) return redirect('/')
def scraper(): pages = mongo.db.pages mars_data = scrape_mars.scrape() pages.update({}, mars_data, upsert=True) return redirect("/", code=302)
def web_scrape(): db.collection.remove({}) mars_data = scrape_mars.scrape() db.collection.insert_one(mars_data) return render_template('index.html')
def scrape(): mars = mongo.db.mars_db data = scrape_mars.scrape() mars.update({}, data, upsert=True) return redirect('/', code=302)
def scrape(): mars_info = scrape_mars.scrape() mars_data = mongo.db.mars_data mars_data.update({}, mars_info, upsert=True) return redirect("/", code=302)
import pymongo import scrape_mars conn = 'mongodb://localhost:27017' client = pymongo.MongoClient(conn) db = client.mydatabase collection = db.mars data = scrape_mars.scrape() collection.insert(data)
def scrape(): mars_results = mongo.db.mars_result mars_data = scrape_mars.scrape() #db.mars_results.insert_one(mars_data) mars_results.update({}, mars_data, upsert=True) return redirect("/", code=302)
def scrape(): news_data = scrape_mars.scrape() mongo.db.mars.update({}, news_data, upsert=True) return redirect("/")
def scraper(): mars = mongo.db.mars mars_data = scrape() mars.update({}, mars_data, upsert=True) return redirect("/", code=302)
def scrape(): mars_db = mongo.db.mars_db mars_data = scrape_mars.scrape() mars_db.update({},mars_data,upsert=True) return redirect("/")
def scrape(): mars_dict = mongo.db.mars_dict mars_data = scrape_mars.scrape() mars_dict.update({}, mars_data, upsert=True) return redirect("/", code=302)
def scrape(): data = scrape_mars.scrape() mongo.db.collection.update({}, data, upsert = True) return redirect("/")
def scraped(): mars_data = mongo.db.mars_data mars_data_scrape = scrape_mars.scrape() mars_data.update({}, mars_data_scrape, upsert=True) return redirect("http://localhost:5000/", code=302)
def scraper(): mars_data = mongo.db.mars_data mars_data_data = scrape_mars.scrape() print(mars_data_data) mars_data.update({}, mars_data_data, upsert=True) return redirect("/")