mdbq 2.3.4__tar.gz → 2.3.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mdbq-2.3.4 → mdbq-2.3.5}/PKG-INFO +1 -1
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/aggregation/aggregation.py +1 -1
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/clean/data_clean.py +3 -3
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/spider/aikucun.py +18 -16
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq.egg-info/PKG-INFO +1 -1
- {mdbq-2.3.4 → mdbq-2.3.5}/setup.py +1 -1
- {mdbq-2.3.4 → mdbq-2.3.5}/README.txt +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/__version__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/aggregation/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/aggregation/df_types.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/aggregation/mysql_types.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/aggregation/optimize_data.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/aggregation/query_data.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/bdup/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/bdup/bdup.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/clean/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/company/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/company/copysh.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/company/home_sh.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/config/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/config/get_myconf.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/config/products.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/config/set_support.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/config/update_conf.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/dataframe/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/dataframe/converter.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/log/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/log/mylogger.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/mongo/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/mongo/mongo.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/mysql/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/mysql/mysql.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/mysql/s_query.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/mysql/year_month_day.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/other/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/other/porxy.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/other/pov_city.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/other/sku_picture.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/other/ua_sj.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/pbix/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/pbix/pbix_refresh.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/pbix/refresh_all.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/pbix/refresh_all_old.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/req_post/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/req_post/req_tb.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq/spider/__init__.py +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq.egg-info/SOURCES.txt +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq.egg-info/dependency_links.txt +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/mdbq.egg-info/top_level.txt +0 -0
- {mdbq-2.3.4 → mdbq-2.3.5}/setup.cfg +0 -0
@@ -526,7 +526,7 @@ class DatabaseUpdate:
|
|
526
526
|
elif name.endswith('.csv') and '竞店分析-来源分析-入店搜索词' in name:
|
527
527
|
df = pd.read_csv(os.path.join(root, name), encoding='utf-8_sig', header=0, na_filter=False)
|
528
528
|
check_remove_file = True
|
529
|
-
elif name.endswith('.csv') and '爱库存_商品榜单' in name:
|
529
|
+
elif name.endswith('.csv') and '爱库存_商品榜单_spu_' in name:
|
530
530
|
df = pd.read_csv(os.path.join(root, name), encoding='utf-8_sig', header=0, na_filter=False)
|
531
531
|
check_remove_file = True
|
532
532
|
# ----------------------- 京东数据处理分界线 -----------------------
|
@@ -1147,7 +1147,7 @@ class DataClean:
|
|
1147
1147
|
path = self.path
|
1148
1148
|
for root, dirs, files in os.walk(path, topdown=False):
|
1149
1149
|
for name in files:
|
1150
|
-
print(name)
|
1150
|
+
# print(name)
|
1151
1151
|
is_continue = False
|
1152
1152
|
if is_except:
|
1153
1153
|
for item in is_except:
|
@@ -1158,7 +1158,7 @@ class DataClean:
|
|
1158
1158
|
break
|
1159
1159
|
if is_continue: # 需要排除不做处理的文件或文件夹
|
1160
1160
|
continue
|
1161
|
-
print(is_except, is_continue)
|
1161
|
+
# print(is_except, is_continue)
|
1162
1162
|
def bib(paths, _as_month=None):
|
1163
1163
|
"""闭包函数"""
|
1164
1164
|
self.move_files(path=path, _name=name, target_path=paths, _as_month=_as_month)
|
@@ -1348,7 +1348,7 @@ class DataClean:
|
|
1348
1348
|
elif name.endswith('.csv') and '京东推广关键词点击成交报表' in name:
|
1349
1349
|
t_path = str(pathlib.Path(self.source_path, '京东报表/JD推广_关键词报表'))
|
1350
1350
|
bib(t_path, _as_month=True)
|
1351
|
-
elif name.endswith('.csv') and '爱库存
|
1351
|
+
elif name.endswith('.csv') and '爱库存_商品榜单_spu_' in name:
|
1352
1352
|
t_path = str(pathlib.Path(self.source_path, '爱库存/商品榜单'))
|
1353
1353
|
bib(t_path, _as_month=True)
|
1354
1354
|
# 京东分界线 ------- 结束标记
|
@@ -43,11 +43,12 @@ else:
|
|
43
43
|
Source_Path = str(pathlib.Path(Data_Path, '原始文件2'))
|
44
44
|
|
45
45
|
|
46
|
-
def
|
46
|
+
def get_cookie_aikucun():
|
47
47
|
"""
|
48
48
|
"""
|
49
49
|
_url = 'https://gray-merc.aikucun.com/index.html'
|
50
|
-
cookie_path = '
|
50
|
+
cookie_path = os.path.join(set_support.SetSupport(dirname='support').dirname, 'cookies')
|
51
|
+
filename_aikucun = 'cookie_aikucun.txt'
|
51
52
|
print(_url)
|
52
53
|
|
53
54
|
option = webdriver.ChromeOptions() # 浏览器启动选项
|
@@ -79,7 +80,6 @@ def test():
|
|
79
80
|
service = Service(chromedriver_path)
|
80
81
|
_driver = webdriver.Chrome(service=service, options=option) # 创建Chrome驱动程序实例
|
81
82
|
|
82
|
-
print('yes')
|
83
83
|
# 登录
|
84
84
|
_driver.get(_url)
|
85
85
|
time.sleep(0.1)
|
@@ -91,16 +91,16 @@ def test():
|
|
91
91
|
time.sleep(0.1)
|
92
92
|
|
93
93
|
|
94
|
-
_file = os.path.join(cookie_path,
|
94
|
+
_file = os.path.join(cookie_path, filename_aikucun)
|
95
95
|
with open(_file, 'w') as f:
|
96
96
|
# 将cookies保存为json格式
|
97
97
|
cookies_list = _driver.get_cookies()
|
98
|
-
for cookie in cookies_list:
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
98
|
+
# for cookie in cookies_list:
|
99
|
+
# # 该字段有问题所以删除就可以
|
100
|
+
# if 'expiry' in cookie:
|
101
|
+
# del cookie['expiry']
|
102
|
+
# # if 'domain' in cookie:
|
103
|
+
# # cookie['domain'] = '.taobao.com'
|
104
104
|
cookies_list = json.dumps(cookies_list)
|
105
105
|
f.write(cookies_list)
|
106
106
|
print(f'cookie已保存: {_file}')
|
@@ -109,7 +109,8 @@ def test():
|
|
109
109
|
|
110
110
|
class AikuCun:
|
111
111
|
def __init__(self):
|
112
|
-
self.url = 'https://gray-merc.aikucun.com/index.html'
|
112
|
+
# self.url = 'https://gray-merc.aikucun.com/index.html'
|
113
|
+
self.sp_url = 'https://treasurebox.aikucun.com/dashboard/commodity/ranking/merchant?LS=true&shopId=1814114991487782914&from=menu&v=0.1936043279838604'
|
113
114
|
self.cookie_path = os.path.join(set_support.SetSupport(dirname='support').dirname, 'cookies')
|
114
115
|
|
115
116
|
def login(self, shop_name='aikucun'):
|
@@ -173,7 +174,7 @@ class AikuCun:
|
|
173
174
|
_driver.maximize_window() # 窗口最大化 方便后续加载数据
|
174
175
|
|
175
176
|
# 登录
|
176
|
-
_driver.get(self.
|
177
|
+
_driver.get(self.sp_url)
|
177
178
|
_driver.delete_all_cookies() # 首先清除浏览器打开已有的cookies
|
178
179
|
name_lists = os.listdir(self.cookie_path) # cookie 放在主目录下的 cookies 文件夹
|
179
180
|
for name in name_lists:
|
@@ -193,9 +194,10 @@ class AikuCun:
|
|
193
194
|
"""
|
194
195
|
|
195
196
|
_driver = self.login(shop_name=shop_name)
|
196
|
-
|
197
|
-
_driver.get(
|
197
|
+
|
198
|
+
_driver.get(self.sp_url)
|
198
199
|
time.sleep(3)
|
200
|
+
# breakpoint()
|
199
201
|
|
200
202
|
today = datetime.date.today()
|
201
203
|
for date_s in range(date_num):
|
@@ -271,7 +273,7 @@ class AikuCun:
|
|
271
273
|
|
272
274
|
def akucun():
|
273
275
|
akc = AikuCun()
|
274
|
-
akc.get_data(shop_name='aikucun', date_num=
|
276
|
+
akc.get_data(shop_name='aikucun', date_num=2)
|
275
277
|
# akc.clean_data()
|
276
278
|
|
277
279
|
# 新版 数据分类
|
@@ -296,5 +298,5 @@ def akucun():
|
|
296
298
|
|
297
299
|
if __name__ == '__main__':
|
298
300
|
pass
|
299
|
-
#
|
301
|
+
# get_cookie_aikucun()
|
300
302
|
akucun()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|