Facebook
From Botched Gibbon, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 53
  1.     def __init__(self, URL):
  2.         """
  3.         Create a new scraper object
  4.  
  5.         @param URL:  Web address to get data from
  6.         """
  7.  
  8.         self.URL = URL
  9.         self.log = logging.getLogger(__name__)
  10.         self.log.debug("Scraper for %s created", self.URL)
  11.  
  12.         def run(self):
  13.         """
  14.         Run the program
  15.         """
  16.         self.log.debug("Running")
  17.  
  18.         #Fetch the data
  19.         data = self.getData()
  20.  
  21.         #Process it
  22.         output = self.parseData(data.json())
  23.  
  24.         #Return the output
  25.         return output
  26.