docker部署, 登录成功后获取了electricity charge balance, year power usage和year power charge
然后就报错 TypeError: 'NoneType' object is not subscriptable
2023-08-08 07:22:57 [INFO ] ---- Webdriver initialized.
2023-08-08 07:24:44 [INFO ] ---- Login successfully on https://www.95598.cn/osgweb/login
2023-08-08 07:25:09 [INFO ] ---- get all user id: [' ']
2023-08-08 07:25:42 [INFO ] ---- Get electricity charge balance for successfully, balance is 126.61 CNY.
2023-08-08 07:26:19 [INFO ] ---- Get year power usage for successfully, usage is 2569 kwh
2023-08-08 07:26:19 [INFO ] ---- Get year power charge for successfully, yealrly charge is 1487.96 CNY
2023-08-08 07:26:36 [ERROR ] ---- state-refresh task failed, reason is 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "main.py", line 57, in run_task
user_id_list, balance_list, last_daily_date_list, last_daily_usage_list, yearly_charge_list, yearly_usage_list = data_fetcher.fetch()
File "/app/data_fetcher.py", line 86, in fetch
raise e
File "/app/data_fetcher.py", line 83, in fetch
return self._fetch()
File "/app/data_fetcher.py", line 111, in _fetch
last_daily_date_list, last_daily_usage_list, yearly_charge_list, yearly_usage_list = self._get_other_data(driver, user_id_list)
File "/app/data_fetcher.py", line 230, in _get_other_data
self._save_daily_usage(driver, user_id_list[i - 1])
File "/app/data_fetcher.py", line 332, in _save_daily_usage
collection = self.db[collection_name]
TypeError: 'NoneType' object is not subscriptable
docker部署, 登录成功后获取了electricity charge balance, year power usage和year power charge
然后就报错 TypeError: 'NoneType' object is not subscriptable
2023-08-08 07:22:57 [INFO ] ---- Webdriver initialized. 2023-08-08 07:24:44 [INFO ] ---- Login successfully on https://www.95598.cn/osgweb/login 2023-08-08 07:25:09 [INFO ] ---- get all user id: [' '] 2023-08-08 07:25:42 [INFO ] ---- Get electricity charge balance for successfully, balance is 126.61 CNY. 2023-08-08 07:26:19 [INFO ] ---- Get year power usage for successfully, usage is 2569 kwh 2023-08-08 07:26:19 [INFO ] ---- Get year power charge for successfully, yealrly charge is 1487.96 CNY 2023-08-08 07:26:36 [ERROR ] ---- state-refresh task failed, reason is 'NoneType' object is not subscriptable Traceback (most recent call last): File "main.py", line 57, in run_task user_id_list, balance_list, last_daily_date_list, last_daily_usage_list, yearly_charge_list, yearly_usage_list = data_fetcher.fetch() File "/app/data_fetcher.py", line 86, in fetch raise e File "/app/data_fetcher.py", line 83, in fetch return self._fetch() File "/app/data_fetcher.py", line 111, in _fetch last_daily_date_list, last_daily_usage_list, yearly_charge_list, yearly_usage_list = self._get_other_data(driver, user_id_list) File "/app/data_fetcher.py", line 230, in _get_other_data self._save_daily_usage(driver, user_id_list[i - 1]) File "/app/data_fetcher.py", line 332, in _save_daily_usage collection = self.db[collection_name] TypeError: 'NoneType' object is not subscriptable