ntalekt / Cox_Data_Usage

Script that collects Cox Communications data usage for internet subscribers
18 stars 8 forks source link

fails with "AttributeError: 'NoneType' object has no attribute 'find'" #1

Closed skymoo closed 6 years ago

skymoo commented 6 years ago

When I run this on my HA box, it's failing with:

Traceback (most recent call last):
  File "/cox/cox-data-usage.py", line 42, in <module>
    login_form.input({'username': cox_user, 'password': cox_pass})
  File "/srv/cox/lib/python3.6/site-packages/mechanicalsoup/form.py", line 59, in set_input
    i = self.form.find("input", {"name": name})
AttributeError: 'NoneType' object has no attribute 'find'

This on a on Alpine linux container

ntalekt commented 6 years ago

That's weird, it's working fine for me over here. It's almost like it can't find the login form to populate with the login variables.

Try browsing to 'https://www.cox.com/resaccount/sign-in.cox' directly and confirm you can login.

skymoo commented 6 years ago

It seems to be a temporary authentication issue, that happens every now and again. If I try again in an hour or so it works correctly. I'm currently looking at adding some code to catch this and return and clearer error.