I followed your lead and created a database in InfluxDB called xfinity. My config.yaml calls to that DB like yours does in your example code.
Here’s the relevant bits from the logs:
return self.find_element(by=By.XPATH, value=xpath)
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 978, in find_element 'value': value})['value'] File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response)
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: {"errorMessage":"Unable to find element with xpath '//*[@ng-bind-html=\"usage.details.userMessage.monthlyUsageState\"]'","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Content-Length":"150","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:44829","User-Agent":"selenium/3.14.1 (python linux)"},"httpVersion":"1.1","method":"POST","post":"{\"using\": \"xpath\", \"value\": \"//*[@ng-bind-html=\\\"usage.details.userMessage.monthlyUsageState\\\"]\", \"sessionId\": \"b2fc5180-4ca4-11eb-9605-1f55dec06333\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/b2fc5180-4ca4-11eb-9605-1f55dec06333/element"}}
Screenshot: available via screen
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/InfluxdbComcast.py", line 144, in <module>
main()
File "/src/InfluxdbComcast.py", line 140, in main
collector.run()
File "/src/InfluxdbComcast.py", line 93, in run
res = xfinity.run()
File "/usr/local/lib/python3.6/site-packages/xfinity_usage/xfinity_usage.py", line 138, in run
res = self.get_usage()
File "/usr/local/lib/python3.6/site-packages/xfinity_usage/xfinity_usage.py", line 302, in get_usage
raise RuntimeError('Unable to find monthly usage div.')
RuntimeError: Unable to find monthly usage div.
Loading Configuration File config.ini
Configuration Successfully Loaded
/usr/local/lib/python3.6/site-packages/selenium/webdriver/phantomjs/webdriver.py:49: UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead
warnings.warn('Selenium support for PhantomJS has been deprecated, please use headless '
[2021-01-02 02:47:42,083 ERROR] Error getting usage JSON; falling back to scraping page
[2021-01-02 02:48:07,679 CRITICAL] Unable to find monthly usage div on page
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/xfinity_usage/xfinity_usage.py", line 131, in run
res.update(self.extract_current_from_json(deepcopy(res['raw'])))
File "/usr/local/lib/python3.6/site-packages/xfinity_usage/xfinity_usage.py", line 267, in extract_current_from_json for item in raw['usageMonths']:KeyError: 'usageMonths'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/xfinity_usage/xfinity_usage.py", line 294, in get_usage
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 978, in find_element
'value': value})['value']
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)