Skip to content

Commit

Permalink
add QQ group
Browse files Browse the repository at this point in the history
  • Loading branch information
ARC-MX committed Dec 19, 2024
1 parent 81468d1 commit f53b28a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 26 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,16 @@ TO-DO
- [X] 增加离线滑动验证码识别方案
- [X] 添加默认推送服务,电费余额不足提醒
- [ ] 。。。
# **技术交流群**
由于现在用户越来越多,稍有问题大家就在github上发issue,我有点回复不过来了,故创建一个付费加入的QQ群。该群只是方便大家讨论,不承诺技术协助,我想大多数用户参考历史issue和文档都能解决自己的问题
## 入群方式
通过为项目点star并微信打赏备注QQ名或QQ号等信息,入群会审核这些信息
<p align="center">
<img src="assets/QQ_group.jpg" width=200 style="margin-right: 70px";/>
</p>
## 再次说明,希望大家通过认真看文档和浏览历史issue解决问题,毕竟收费群不是开源项目的本意。
Binary file added assets/QQ_group.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 33 additions & 26 deletions scripts/data_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,33 +380,40 @@ def _fetch(self):

current_userid_list = copy.deepcopy(user_id_list)

for i, user_id in enumerate(user_id_list):
# switch to electricity charge balance page
driver.get(BALANCE_URL)
time.sleep(self.RETRY_WAIT_TIME_OFFSET_UNIT)
self._click_button(driver, By.CLASS_NAME, "el-input__suffix")
time.sleep(self.RETRY_WAIT_TIME_OFFSET_UNIT)
self._click_button(driver, By.XPATH, f"/html/body/div[2]/div[1]/div[1]/ul/li[{i+1}]/span")
time.sleep(self.RETRY_WAIT_TIME_OFFSET_UNIT)
current_userid = self._get_current_userid(driver)
if current_userid in self.IGNORE_USER_ID:
current_userid_list.remove(current_userid)
logging.info(f"The user ID {current_userid} will be ignored in user_id_list")
continue
else:
### get data
balance, last_daily_date, last_daily_usage, yearly_charge, yearly_usage, month_data, month_usage, month_charge = self._get_all_data(driver, user_id)

balance_list.append(balance)
last_daily_date_list.append(last_daily_date)
last_daily_usage_list.append(last_daily_usage)
yearly_charge_list.append(yearly_charge)
yearly_usage_list.append(yearly_usage)
month_list.append(month_data)
month_usage_list.append(month_usage)
month_charge_list.append(month_charge)

for i, user_id in enumerate(user_id_list):
try:
# switch to electricity charge balance page
driver.get(BALANCE_URL)
time.sleep(self.RETRY_WAIT_TIME_OFFSET_UNIT)
self._click_button(driver, By.CLASS_NAME, "el-input__suffix")
time.sleep(self.RETRY_WAIT_TIME_OFFSET_UNIT)
self._click_button(driver, By.XPATH, f"/html/body/div[2]/div[1]/div[1]/ul/li[{i+1}]/span")
time.sleep(self.RETRY_WAIT_TIME_OFFSET_UNIT)
current_userid = self._get_current_userid(driver)
if current_userid in self.IGNORE_USER_ID:
current_userid_list.remove(current_userid)
logging.info(f"The user ID {current_userid} will be ignored in user_id_list")
continue
else:
### get data
balance, last_daily_date, last_daily_usage, yearly_charge, yearly_usage, month_data, month_usage, month_charge = self._get_all_data(driver, user_id)

balance_list.append(balance)
last_daily_date_list.append(last_daily_date)
last_daily_usage_list.append(last_daily_usage)
yearly_charge_list.append(yearly_charge)
yearly_usage_list.append(yearly_usage)
month_list.append(month_data)
month_usage_list.append(month_usage)
month_charge_list.append(month_charge)

time.sleep(self.RETRY_WAIT_TIME_OFFSET_UNIT)
except Exception as e:
if (i != len(user_id_list)):
logging.info(f"The current user {user_id} data fetching failed {e}, the next user data will be fetched.")
else:
logging.info(f"The user {user_id} data fetching failed, {e}")
continue

driver.quit()

Expand Down

0 comments on commit f53b28a

Please sign in to comment.