A small typo in summary.py builds the URL just slightly incorrectly, which causes a 404 Not Found to be returned by the server when the HTTP request is executed. This logic seems it would only hit when calling kenpompy.summary.get_teamstats()without providing a value for the season parameter, but explicitly specifying defense=True.
(I'll be submitting a PR momentarily to fix this.)
Reproduction
Code
import kenpompy.utils as kp
import kenpompy.summary as kp_s
browser = kp.login('valid_email@provider.domain', 'valid_password')
summary = kp_s.get_teamstats(browser, defense=True)
Expected behavior
The code retrieves the page containing the defensive team statistics and parses it into a DataFrame object.
Actual behavior
The code attempts to find the relevant table element in the DOM, but is unsuccessful (since the table doesn't exist in the 404 document) and throws IndexError: list index out of range at summary.py:155.
A small typo in
summary.py
builds the URL just slightly incorrectly, which causes a404 Not Found
to be returned by the server when the HTTP request is executed. This logic seems it would only hit when callingkenpompy.summary.get_teamstats()
without providing a value for theseason
parameter, but explicitly specifyingdefense=True
.(I'll be submitting a PR momentarily to fix this.)
Reproduction
Code
Expected behavior
The code retrieves the page containing the defensive team statistics and parses it into a
DataFrame
object.Actual behavior
The code attempts to find the relevant
table
element in the DOM, but is unsuccessful (since the table doesn't exist in the404
document) and throwsIndexError: list index out of range
atsummary.py:155
.