dump() missing 1 required positional argument: 'fp' in python json

前端 未结 1 1554
不知归路
不知归路 2021-02-05 00:58

I am trying to prettify the json format but i am getting this error:

import requests as tt
from bs4 import BeautifulSoup
import json

get_url=tt.get(\"https://in         


        
相关标签:
1条回答
  • 2021-02-05 01:50

    Use json.dumps() instead. json.dump() needs a file object and dump JSON to it.

    0 讨论(0)
提交回复
热议问题