Skip to content

Error 403 when accessing Rewe API to get JSON #14

@Nerbry72

Description

@Nerbry72

Unfortunally the script stopped working for me few days ago :/
Thats the output from 403 Branch:

File "Python\Python311\Lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Python\Python311\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Python\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "Python\Python311\Lib\json\decoder.py", line 355, in raw_decode

raise JSONDecodeError("Expecting value", s, err.value) from None

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

File "rewe_discounts.py", line 194, in
data = scraper.get(url).json()
^^^^^^^^^^^^^^^^^^^^^^^
File "Python\Python311\Lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
FAIL: Unknown error while fetching discounts from https://mobile-api.rewe.de/api/v3/all-offers?marketCode=562286, maybe a typo or the server rejected the request.

Upon opening the link https://mobile-api.rewe.de/api/v3/all-offers?marketCode=562286 manuelly inside my browser it works just fine. Rewe must have improved their IT Skills recently😁
Doesnt necessarily look like an IP block for me.
I've been using the script for a relatively long time, really great work, too bad it doesn't work for me now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions