0

I have an GET api that returns

file_url

and several other variables. I want to only export

file_url

and just dump other variables.

import requests
response = requests.get("foo.xyz/index.php?example=example")
print(response.content)

but i only get an output of "illegible" full response.

b'<?xml version="1.0" encoding="UTF-8"?><posts  count="3893" offset="0"><post height="4089" core="0"file_url="https://foo.xyz/example.jpg"

[Program finished]

Chris
  • 112,704
  • 77
  • 249
  • 231
  • Please read [ask] and then update your question to show an actual example. But I suspect you're just trying to figure out how to [access part of a dictionary](https://stackoverflow.com/q/5404665/354577)? – Chris Jan 21 '22 at 19:12
  • I want to request something from an GET api and use only one "variable" (in this case file_url). I could find a way to get an entire response but i can't manage to find an option to only print this one "variable" @Chris – NightShadeTVN Jan 21 '22 at 19:50
  • @Cheis updated??? – NightShadeTVN Jan 21 '22 at 20:01
  • That looks like XML, but it isn't well-formed. Don't the `post` and `posts` elements close? – Chris Jan 21 '22 at 20:43
  • They close but i just anonimized the thing. – NightShadeTVN Jan 22 '22 at 11:56

0 Answers0