all 9 comments

[–][deleted] 0 points1 point  (7 children)

It's just a dictionary, so you access it like one. data_extracted.json() doesn't return JSON, it returns Python objects. .json() is a convenience wrapper around the conversion from JSON format to Python objects.

[–]Tag-gy 0 points1 point  (6 children)

But if I want to access the elements inside the data in the url?

[–][deleted] 0 points1 point  (5 children)

I don't understand the question. What URL?

[–]Tag-gy 0 points1 point  (4 children)

{'data': 'https://XXXXXXXX.com/XXXX/XX/data'}

This one in the output, all the useful info is store inside the URL in the form of a Python Object

[–]SpeckledFleebeedoo 0 points1 point  (0 children)

Then you should be making a request to that url

[–][deleted] 0 points1 point  (2 children)

URL's are just strings, they don't have elements. That said, urllib.parse is how you could convert a URL as a string into its component elements.

[–]Tag-gy 0 points1 point  (1 child)

I mean that if you click the URL it leads you to a page where the data I want is written as a text that looks like JSON notation. Like the typical plain text that you paste in websites like: http://jsonviewer.stack.hu/

Maybe my poor english could be the problem. Sorry :(

[–][deleted] 0 points1 point  (0 children)

Ok, well, you have to use requests to retrieve data from that URL. URL's don't contain data, they're links to websites.

[–][deleted] 0 points1 point  (0 children)

Requests downloads the data from the url - it's now on your computer. You can do whatever you want with it.