Skip to content

show_categories() throws RuntimeError because categoryListModel is not returned in response data #2

@allardbrain

Description

@allardbrain

Hey Alec, really great work you've done on this package! I've been playing around with it locally and I've run into an issue when trying to make this foundational call:

from shopgoodwill_pkg.src.ShopGoodwill import ShopGoodwill

sgw = ShopGoodwill()
sgw.show_categories(show_children=False)

It's triggering the RuntimeError described here in ShopGoodwill.py:

raise RuntimeWarning('Failed to retrieve and parse ShopGoodwill sellers or categories. Check your internet connection.')

Since I was able to run example.py just fine, I was skeptical that this was truly a RuntimeError. I put in a bunch of pdb statements and was able to track down the cause of the issue.

The data that's returned here returns a huge list of locations, but does not contain any category information at all. Thus, the needed categoryListModel and categoryModel keys shown below are missing from the dictionary.

categories = val[1]['body']['categoryListModel']['categoryModel']

I'd be happy to submit a PR to fix this if you could give me some direction on how to access the categoryListModel from another web page on their site, perhaps? I'm not sure how I'd go about finding that.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions