# Python and XML

**URL:** <https://forums.plex.tv/t/python-and-xml/1328>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [March 27, 2009, 1:35am UTC](https://forums.plex.tv/t/python-and-xml/1328 "2009-03-27T01:35:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![flynfish](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@flynfish](https://forums.plex.tv/u/flynfish)\
**Post date:** [March 27, 2009, 1:35am UTC](https://forums.plex.tv/t/python-and-xml/1328/1 "2009-03-27T01:35:23Z")

</div>

I am working on a photo plugin.   
  
  
  
My RSS XML is structured like the following:

```auto

<item><br />
	  <title>Lightning Bolt. June 2006.</title><br />
	  <link>http://www.kylelamyphoto.com/gallery/2390052_crHBZ#106085683_AHvBT</link><br />
	 <br />
	  <media:group><br />
		<media:content url="placeholder" fileSize="13508" type="image/jpeg" medium="image" width="290" height="450"><br />
		  <media:hash algo="md5">a872bcac89630bea7c761d432357e640</media:hash><br />
		</media:content><br />
	  </media:group><br />
	  <media:keywords>lightning, weather, night, clouds, thunder, flash, strike, electricity, portfolio</media:keywords><br />
	  <media:copyright url="http://www.kylelamyphoto.com">kylelamyphoto</media:copyright><br />
	  <media:credit role="photographer">kylelamyphoto</media:credit><br />
</item>

```

  
  
Is there a way to access the XML tags that have a colon in python? I know I can do item.link in order to get the link attribute, but I really need to get inside the media:group and access the media:content attribute.   
  
Thanks.

---

<div class="post-metadata">

**Author:** ![elan](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/elan/32/5_2.png) [@elan](https://forums.plex.tv/u/elan)\
**Post date:** [March 27, 2009, 7:39pm UTC](https://forums.plex.tv/t/python-and-xml/1328/2 "2009-03-27T19:39:43Z")

</div>

If you want to access with the XML parser, you’ll need to add a namespace definition and then you can use XPATH like …xpath(“media:content”)[0].get(‘url’). Check the Revision3 plug-in for an example, they access the media:content element.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 8:24pm UTC](https://forums.plex.tv/t/python-and-xml/1328/3 "2019-12-20T20:24:14Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
