'WebScraping using Python & Azure : How to run an Azure Function to store pandas dataframe into a CosmoDB?

My porpouse is to automate the aquisition of data from a website.

I have my python scripts to scrape tables and i can store it as a dataframe or in a csv,xlsx format. I would like to run this script (i tried with an Azure function with TimeTrigger) to weekly store the data in a CosmoDB so i can use it in the future.

i was thinking about this process but right now it doesn't work:

  1. Write an Azure TimeTrigger Function BUT I can't return a dataframe as output
  2. Connect the out pandas dataframe to the cosmos DB
  3. Store the in the DB

Someone could help me to find a solution?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source