vendredi 23 juillet 2021

I am trying extract data from website using request and bs4 python module. when i try to access this code, got below error message to json

capcha2 = requests.post(url=url1,headers=headers3,data=payload1)
print(capcha2)
cap = json.loads(capcha2.text)
captcha_status = cap['required']
print(captcha_status)

when i try to load value to json, got below error message.

Traceback (most recent call last):
  File "C:\Users\Madeena\PycharmProjects\pythonProject\pythonProject2\ahamed3.py", line 39, in <module>
    cap = json.loads(capcha2.text)
  File "C:\Users\Madeena\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\Madeena\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\Madeena\AppData\Local\Programs\Python\Python39\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)

i tried capcha2 = requests.post(url=url1,headers=headers3,data=payload1).json() got same error message




Aucun commentaire:

Enregistrer un commentaire