Ejemplo n.º 1
0
# coding: utf-8
'''
获取安居客楼盘评测
'''

import types
import urllib2
import psycopg2.extras
import psycopg2 as pg
from bs4 import BeautifulSoup
from config import *
from siemtools import utils

LOGGER = utils.initLogger(LOG_ROUTE)


def value_data_msg(url_list, batch_id):
    """
    楼盘测评信息获取
    :param url_list:
    :return:
    """
    value_dict_list = []
    try:
        for i in range(len(url_list)):
            data_url = []
            value_title = []
            value_note = []
            html = urllib2.urlopen(url_list[i]).read()
            soup = BeautifulSoup(html, "html.parser", from_encoding="utf-8")
            build_name = soup.find("h1").text
Ejemplo n.º 2
0
import subprocess
from smtplib import SMTP
from email.mime.text import MIMEText
from email.header import Header
from config import email_info
import config
import time
import os
from datetime import datetime
from siemtools import utils

# 主函数
path = "/data/wxb-data/wxb-data1"
count = 0
flag = 0
LOGGER = utils.initLogger("/data/wxb-data/wxb_data.log")


def getInfoMain():
    global count
    ls = os.listdir(path)
    count += len(ls)
    if count:
        # #发邮件
        subject = '数据同步提醒'
        content = '数据已经同步到中转服务器'
        global flag
        if flag == 1:
            now = datetime.now().strftime("%H")
            if now == config.first_time or now == config.last_time:
                LOGGER.info(