You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
366 B
Python
15 lines
366 B
Python
import oursql
|
|
|
|
class Environment(object):
|
|
def connect(self, host="localhost", username="root", password="", database="learn"):
|
|
self.db = oursql.connect(host=host, user=username, passwd=password, db=database)
|
|
self.connected = True
|
|
|
|
def log(self, text):
|
|
print text
|
|
|
|
def Scraper(self, scraper_class):
|
|
s = scraper_class(self.db)
|
|
s.env = self
|
|
return s
|