def __init__(self): setup = webbase.SetUp() dr = setup.web_setup() self.driver = webbase.Web(dr) self.cf = conf.Conf() self.driver.get_url(self.cf.get_conf_data("taobao")["url"]) self.lg = logoutput.Logger() self.gx = getxml.XmlOperation() self.db = mysql.Mysql() self.db.connect_mysql() self.cur = self.db.cur
def __init__(self): setup = webbase.SetUp() dr = setup.web_setup() self.driver = webbase.Web(dr) self.cf = conf.Conf() self.driver.get_url(self.cf.get_conf_data("ziroom")["roomurl"]) self.lg = logoutput.Logger() self.gx = getxml.XmlOperation() self.db = mysql.Mysql() self.db.connect_mysql() self.cur = self.db.cur self.data = pd.DataFrame(columns=[ "图片地址", "平米数", "楼层", "房屋格局", "交通位置", "价格", "小区名称", "租房页面url", "收费方式" ])
def __init__(self): self.lg = logoutput.Logger() # 打开excel表格 try: # data = xlrd.open_workbook(path) self.open_excel() self.table = self.data.sheet_by_index(0) self.ROW_COUNT = self.table.nrows except Exception as e: self.lg.error(e) self.lg.error("打开Excel表格失败!") # 数据库连接 try: self.db = mysql.Mysql() self.db.connect_mysql() except Exception as e: self.lg.error(e) self.lg.error("连接数据库失败!")
def __init__(self): self.lg=logoutput.Logger()