arthurdjn / allpoetry

Simple Python API for allpoetry.com server. Retrieve poems, authors and more in a few line of code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Value error

RazyRo opened this issue · comments

commented

i am a non coder
i simple run the given script for connecting to api as per given usage code (from allpoetry import AllPoetry

Optional, but recommended

USERNAME = "Rohxx"
PASSWORD = "sddfhxxxx"

Connect to the API

api = AllPoetry(USERNAME, PASSWORD))

Error:

Traceback (most recent call last):
File "c:\Users\XYZ\Downloads\allpoetry\allpoetry-main\Poems.py", line 8, in
api = AllPoetry(USERNAME, PASSWORD)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\XYZ\Downloads\allpoetry\allpoetry-main\allpoetry\api.py", line 39, in init
self.login(username, password)
File "c:\Users\XYZ\Downloads\allpoetry\allpoetry-main\allpoetry\api.py", line 47, in login
form = {hidden_inputs[i].attrib["name"]: hidden_inputs[i].attrib["value"] for i in indices}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\XYZ\Downloads\allpoetry\allpoetry-main\allpoetry\api.py", line 47, in
form = {hidden_inputs[i].attrib["name"]: hidden_inputs[i].attrib["value"] for i in indices}
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "src\lxml\etree.pyx", line 2497, in lxml.etree._Attrib.getitem
KeyError: 'value'