Skip to content

Commit

Permalink
rostelecom over qiwi
Browse files Browse the repository at this point in the history
  • Loading branch information
artyl committed Aug 7, 2022
1 parent 6794316 commit 8bbcb3a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
6 changes: 4 additions & 2 deletions changelist.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,5 +403,7 @@ FIX: МТС снова показывает свое истинное отнош
## mbplugin v1.00.31 (15.07.22) Fix mts new lk, attempt 2
FIX: МТС еще одна попытка починить личный кабинет, пока не ясно где информация по общему пакету

## mbplugin v1.00.32 (??.07.22) Fix mts new lk, attempt 2
FIX: Мгтс отрицательный баланс
## mbplugin v1.00.32 (07.08.22) Fix mgts negative balance, mts refactoring, rt over qiwi
FIX: Мгтс отрицательный баланс
FIX: рефакторинг МТС, убрал часть старого кода, улучшил логирование, немного ускорил
ADD: Получение баланса ростелеком через qiwi. plugin_mode=QIWI
28 changes: 26 additions & 2 deletions plugin/rostelecom.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python3
# -*- coding: utf8 -*-
import browsercontroller
import store, browsercontroller

icon = '789CA5D4B171DB401484E1A719050E5D024257A078C7B97BB852B614041ED7B1B16A708012942BA0FF7BA065DAA2259222780310CB77B8EFEEC8AFDF1E3E55BF1EEEABBE70FE7C6C77B5ECC17DFD79DD9D5C97FB5DF67E9A0717492A3F534F8F3FAA16D1068D605969A16D55DC2ED1BFB810B9C8452E729173AB06F9201F7C18E4837C908FEDF85C72937BF418CAE426373997B592AFE42BF94ABE7273255FC93955C8431EF2CC81AF73F03472DEB5916FE41BF946BE916FE4DBB60F9FF9511F8366DA4A0B6DDB690B397EE1177EE1177EE16F365F1217C22FFCC22FFCC2DF53825FF8855FF8855FF885BFA70BBFF00BBFF00BBFF00B7F4F257EE1177EE1177EE117FE9E66FCC22FFCC22FFCC22FFC7309845FF8855FF8855FF8857F5FEFA5D5C6DF6B8FDFF88DBF9706BFF11BBFF11BBFF11B7F2F1B7EE337580332833603330FEF25C56FFCC66FFCC66FFCC6DFCBCD434C47E6CB9E7B10BFF11B7F6F05FCC66FFCC66FFCC66FFCBD4DF01BBFF11BBFF11BBFF1CF2D64FCC66FFCC66FFCC66FFCBD7DF0A7577CB43AF8D3C7B66F2DFCC11FFCC11FFCC11FFCBDEDF0077FF0077FF0077FF0F796C41FFCC11FFCC11FFCC1DFDB157FF0077FF007748085C1F756C61FFCC11FFCC11FFCC1DFDB9C4186818487850E43D1D3F3A1BECF799A135C877ED7E1B09FE6316FCDCF276D3ED3C77D5B276DCEF3BFDF3DD7E6DCD58DB5BFEBE7DCDE52FB523FF7EF92AB6B4FEB679BFF791FA9EF3E9E3F563FF7DA357DBCAABFB28FB3F5B5EFE74BFAF86FFD857DBC597FECE3CDFAE59DFAF14EFDFCCDDD58FBD2C7FC6DDF587BB68F2B6BFFEAE382DA5FA120AA5C'

Expand Down Expand Up @@ -51,9 +51,33 @@ def data_collector(self):
'jsformula': 'data.balance',
}])


class browserengine_qiwi(browsercontroller.BrowserController):
def data_collector(self):
self.page_goto('https://qiwi.com/payment/form/32558')
self.sleep(3)
self.page_screenshot()
self.page_evaluate("document.querySelectorAll('form input[type=tel]')[0].click()")
self.page_fill('form input[type=tel]', self.login)
for num in range(10):
self.sleep(1)
if '/containers$' in str (self.responses.keys()):
break
else:
self.page_screenshot()
return
self.page_screenshot()
# pp list(self.responses.values())[-1]['elements'][0]['value']
self.result['Balance'] = [v for k,v in self.responses.items() if '/containers$' in k][0]['elements'][0]['value']


def get_balance(login, password, storename=None, **kwargs):
''' На вход логин и пароль, на выходе словарь с результатами '''
return browserengine(login, password, storename, plugin_name=__name__, headless=browsercontroller.NOT_IN_CHROME).main() # ростелеком в headless не работает
pkey = store.get_pkey(login, plugin_name=__name__)
if store.options('plugin_mode', pkey=pkey).upper() == 'QIWI':
return browserengine_qiwi(login, password, storename, plugin_name=__name__).main()
else:
return browserengine(login, password, storename, plugin_name=__name__, headless=browsercontroller.NOT_IN_CHROME).main() # ростелеком в headless не работает


if __name__ == '__main__':
Expand Down

0 comments on commit 8bbcb3a

Please sign in to comment.