brianzq / att-bill-splitter

Command-line tool for splitting AT&T phone bills among lines (Family Plan, Share Value Plan, etc.).
https://brianzq.me/projects/1
MIT License
51 stars 13 forks source link

Issues with 'Account Monthly Charges Share' #18

Closed TheQueasle closed 6 years ago

TheQueasle commented 6 years ago

It looks like the main phone line is not being identified correctly in my case, and the 'Account Monthly Charges Share' is being calculated too low.

Would it be possible to specify via a cli flag which phone line is the 'main' one?

I'm attempting to debug this on my end, but so far have not come up with anything.

brianzq commented 6 years ago

Yea, somehow att changed the order of the users in the bill details page. I already cut a new version on pypi to fix that (by looking for the account holder name at the top of the page). Can you try upgrading to the latest version?

PS: I do have a friend whose account is bit messed up (the account holder name at the top of the page is incorrect somehow) and the fix is not working for him. So let me know if it works for you.

TheQueasle commented 6 years ago

That was my first attempt at solving this (updating to version 0.4.8). Is that the latest version?

When you say 'the account holder name at the top of the page', what specifically are you looking for in the page?

I also started looking at the line https://github.com/brianzq/att-bill-splitter/blob/master/attbillsplitter/main.py#L285

It looks like that object does not have a value on my end in a VERY stripped down test of the code

Python Code:

from bs4 import BeautifulSoup, Tag
markup = open("/tmp/MyBill.html")
soup = BeautifulSoup(markup, 'html.parser')
soup.find('span', class_='hidden-spoken ng-binding').parent.next_sibling.next_sibling.text.strip()

Python Shell Output:

>>> from bs4 import BeautifulSoup, Tag
>>> markup = open("/tmp/MyBill.html")
>>> soup = BeautifulSoup(markup, 'html.parser')
>>> soup.find('span', class_='hidden-spoken ng-binding').parent.next_sibling.next_sibling.text.strip()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'next_sibling'
>>>

It looks like, at least on my end, that there is only a value up to soup.find('span', class_='hidden-spoken ng-binding').parent.

EDIT: All that said - I'm definitely a beginner at python code. Just taking a couple shots in the dark at troubleshooting this issue :smile:

brianzq commented 6 years ago

Interesting. There is a hack you can do to bypass this, which is hard code your account holder name with something like account_holder_name = 'YOUR NAME' to replace line 285.

brianzq commented 6 years ago

meanwhile, I think of a reasonable fix. let me see if I can finish it in the next 15 mins.

brianzq commented 6 years ago

Cut a new version 0.4.9. it should be fixed!

TheQueasle commented 6 years ago

That looks much better!

'Account Monthly Charges Share' is at a much more reasonable value now that I can specify the account holder's phone line.

Thank you sir! :grinning:

brianzq commented 6 years ago

you are very welcome. thanks for the idea of user input.