示例#1
0
def scrape():

    mars_data = Scrape_Mars.scrape_info()

    mongo.db.collection.update({}, Scrape_Mars, upsert=True)

    return redirect("/")
示例#2
0
def scraper():
    data = mongo.db.data

    mars_info = Scrape_Mars.scrape()

    data.update({}, mars_info, upsert=True)
    return redirect('/', code=302)
示例#3
0
def scrape():
    
    mars = mongo.db.mars
    mars_data = Scrape_Mars.scrape()
    mars.update({}, mars_data, upsert=True)
    
    return redirect("http://localhost:5000/", code=302)
def scrape():

    # Run the scrape function
    Mars_Data = Scrape_Mars.scrape_info()

    # Update the Mongo database using update and upsert=True
    mongo.db.collection.update({}, Mars_Data, upsert=True)

    # Redirect back to home page
    return redirect("/")
示例#5
0
def scrape():
    # upload the_list to mongodb so that it can be accessed by flask app
    mars_db = mongo.db.mars
    mars_data = Scrape_Mars.scrape()
    mars_db.update({}, mars_data, upsert=True)
    return "scrape successful"
示例#6
0
def scrape():
    scraped_data = Scrape_Mars.scrape()

    mongo.db.Mars.update({}, scraped_data, upsert=True)
    return redirect('/')