From 129fbc6d7a8c1212b1d2aa54c5ad9ebce8ddf121 Mon Sep 17 00:00:00 2001 From: chen jinqian Date: Sun, 28 Apr 2024 10:00:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=81=E6=B3=A2=E4=B8=AD?= =?UTF-8?q?=E4=BB=8B=E8=B6=85=E5=B8=82=E6=8F=90=E5=8F=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crawler.py | 2 +- localmain.py | 30 ++++++++---------------------- main.py | 3 +++ 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/crawler.py b/crawler.py index 1dff33f..89088a0 100644 --- a/crawler.py +++ b/crawler.py @@ -232,7 +232,7 @@ class Crawler: {"announcementCode": "110-175885", "announcementType":"采购意向"}, {"announcementCode": "110-978863", "announcementType":"采购公告"}, {"announcementCode": "110-943756", "announcementType":"更正公告"}, - {"announcementCode": "110-420383", "announcementType":"非政府采购公告"}, + {"announcementCode": "110-774650", "announcementType":"非政府采购公告"}, {"announcementCode": "110-900461", "announcementType":"结果公告"} ] for typeParam in infoType: diff --git a/localmain.py b/localmain.py index de10afd..b5dbc3c 100644 --- a/localmain.py +++ b/localmain.py @@ -24,29 +24,15 @@ print( # 设置运行环境。如果当前是测试环境,则将is_test设置为true is_test = False print(sys.platform) -if sys.platform == 'win32': - host = '116.62.210.190' - user = 'root' - password = 'Guoyan83086775' - if is_test: - database = 'guoyantest' - file_path = "./jdbc.test.properties" - else: - database = 'guoyan' - file_path = "./jdbc.properties" +host = '116.62.210.190' +user = 'root' +password = 'Guoyan83086775' +if is_test: + database = 'guoyantest' + file_path = "./jdbc.test.properties" else: - if is_test: - file_path = "/opt/eresource_test/webapp/WEB-INF/classes/prod/jdbc.properties" - database = 'guoyantest' - else: - file_path = "/opt/eresource/webapp/WEB-INF/classes/prod/jdbc.properties" - database = 'guoyan' - - # 打开jdbc.properties文件,获取数据库的配置信息 - props = Properties(file_path) - host = 'localhost' - user = props.get('jdbc.username') - password = props.get('jdbc.password') + database = 'guoyan' + file_path = "./jdbc.properties" # 打开数据连接 connect = pymysql.connect(host = host, user = user, password = password, database = database) diff --git a/main.py b/main.py index de915d4..de10afd 100644 --- a/main.py +++ b/main.py @@ -23,14 +23,17 @@ print( # 设置运行环境。如果当前是测试环境,则将is_test设置为true is_test = False +print(sys.platform) if sys.platform == 'win32': host = '116.62.210.190' user = 'root' password = 'Guoyan83086775' if is_test: database = 'guoyantest' + file_path = "./jdbc.test.properties" else: database = 'guoyan' + file_path = "./jdbc.properties" else: if is_test: file_path = "/opt/eresource_test/webapp/WEB-INF/classes/prod/jdbc.properties"