1👍
✅
Currently the code is just finding the first amount that it can. This should work:
desc_soup = BeautifulSoup(price_response)
book_price = desc_soup.lowestusedprice.amount.get_text()
You really shouldn’t be using html.parser
either given that the API response is XML. You should do this instead:
desc_soup = BeautifulSoup(price_response, 'xml')
book_price = desc_soup.LowestUsedPrice.Amount.get_text()
(Note the capitalisation of the tree objects changes. You also need lxml
to be installed for this to work).
Source:stackexchange.com