I have seen some similar questions, but whatever I am asking is not it (I can get at least ). I'm using the three lines below to create an API request that gives different aspects of an article.
feedback = requests.get (self.format_url (api, version), params = payload) json_data = response.json () returns json_data I request that the data come back, and I have come to know how I would like to remove text parameters. The only problem is that I want to preserve the paragraph break, but Ignored the article_text
paragraph break below given below. Is there a standard way to do this, json or is it completely up to the API I'm using? Thanks for your help, I'm new in Python!
article_text = json_data ['objects'] [0] ['text']
Just for anyone to read it, the solution I applied was by searching tag And replace them with tags - Use beautiful soup in text format - it worked. json_data all
No comments:
Post a Comment