|
楼主 |
发表于 2022-11-9 09:58:36
|
显示全部楼层
你把我上回给你的文件,在以下位置添加两行,再打个截屏看看,加载的如何
def _get_eletric_balance(self, driver):
time.sleep(20) ###############添加此行
driver.save_screenshot("screenshot.png") ###############添加此行
driver.find_element(By.XPATH,"//li[@class='inline_block_fix zhanghu-full']//b[@class='cff8']")
time.sleep(5)
for retry_times in range(0, RETRY_TIMES_LIMIT):
electric_balance = driver.find_element(By.XPATH,"//li[@class='inline_block_fix zhanghu-full']//b[@class='cff8']").text
if(not electric_balance.startswith("-")):
break
time.sleep(1)
return float(electric_balance.replace("元","")) |
|