Skip to content
This repository has been archived by the owner on Aug 9, 2019. It is now read-only.

Commit

Permalink
Base downloaders file
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Martín committed Mar 15, 2013
1 parent 1494a0d commit c02609b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions datCrawl/downloaders.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class Downloader(object):
"Base downloader object"
pass


class DefaultDownloader(Downloader):
"Downloader using urllib2"

def get(self, url):
import urllib2
try:
req = urllib2.Request(url)
response = urllib2.urlopen(req)
data = response.read()
return data
except Exception, e:
raise Exception(e)

0 comments on commit c02609b

Please sign in to comment.