diff --git a/shizhan/mysql/bs_duanzi.py b/shizhan/mysql/bs_duanzi.py index eb70e1e..0ac774b 100755 --- a/shizhan/mysql/bs_duanzi.py +++ b/shizhan/mysql/bs_duanzi.py @@ -45,18 +45,19 @@ o = opener.open(url, timeout=10) d = o.read() - pattern = re.compile('
  • .*?

    (.*?)

    .*?

    (.*?)

    .*?
    (.*?)
    ', re.S) + pattern = re.compile('

    (.*?)

    .*?
    .*?

    (.*?)

    .*?
    ', re.S) results = re.findall(pattern, d) for i in results: author = self.tool.replace(i[0]) - onlineTime = self.tool.replace(i[1]) - content = self.tool.replace(i[2]) + # onlineTime = self.tool.replace(i[1]) + content = self.tool.replace(i[1]) - # print author + print author # print onlineTime - # print content + print content - sql = "insert into `bs_duanzi` (`tid`, `author`, `content`, `online_time`, `update_time`, `status`) values (uuid(), '"+author+"','"+content+"','"+onlineTime+"',now(),0);" + time.sleep(0.2) + sql = "insert into `bs_duanzi` (`tid`, `author`, `content`, `online_time`, `update_time`, `status`) values (uuid(), '"+author+"','"+content+"',now(),now(),0);" print sql self.db.insertDB(sql) @@ -86,8 +87,8 @@ lf = LF_WANGWEN() lf.connect() start = time.time() - -for i in range(8175, 0, -1): +# lf.wang(1) +for i in range(30, 0, -1): print '\n页码~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' + str(i) lf.wang(i) lf.close()