Skip to content

Commit

Permalink
Merge pull request #134 from alandtse/ci_fix
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Tse <alandtse@gmail.com>
  • Loading branch information
alandtse committed Feb 2, 2021
2 parents 65a0386 + 613406e commit 3b3a5c2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions teslajsonpy/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,13 +436,14 @@ def get_inputs(soup: BeautifulSoup, searchfield=None) -> Dict[str, str]:
form = soup.find("form", searchfield)
if not form:
form = soup.find("form")
for field in form.find_all("input"):
try:
data[field["name"]] = ""
if field["type"] and field["type"] == "hidden":
data[field["name"]] = field["value"]
except BaseException: # pylint: disable=broad-except
pass
if form.find_all("input"):
for field in form.find_all("input"):
try:
data[field["name"]] = ""
if field["type"] and field["type"] == "hidden":
data[field["name"]] = field["value"]
except BaseException: # pylint: disable=broad-except
pass
return data


Expand Down

0 comments on commit 3b3a5c2

Please sign in to comment.