# beginners question: xpath element

**URL:** <https://forums.plex.tv/t/beginners-question-xpath-element/1098>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [March 2, 2009, 10:29pm UTC](https://forums.plex.tv/t/beginners-question-xpath-element/1098 "2009-03-02T22:29:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivar](https://avatars.discourse-cdn.com/v4/letter/i/51bf81/32.png) [@ivar](https://forums.plex.tv/u/ivar)\
**Post date:** [March 2, 2009, 10:29pm UTC](https://forums.plex.tv/t/beginners-question-xpath-element/1098/1 "2009-03-02T22:29:46Z")

</div>

Hi People,  
  
  
  
I’d be really grateful if someone could point me in the right direction. I’m completly new to Python but it’s so easily read so I’ve managed to get pretty far on just a few hours. But some simple things hinder me and gets me frustrated 🙂  
  
  
  
For example  
  
Log.Add(element.xpath(‘span’)[1]) generates something like \<Element span at 7c9b90\>  
  
if I’d like to fetch what’s inside the span instead, what do I type? ivar , I want to the Log to say “ivar”  
  
  
  
Thanks  
  
Ivar

---

<div class="post-metadata">

**Author:** ![jam](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jam/32/186050_2.png) [@jam](https://forums.plex.tv/u/jam)\
**Post date:** [March 2, 2009, 11:04pm UTC](https://forums.plex.tv/t/beginners-question-xpath-element/1098/2 "2009-03-02T23:04:13Z")

</div>

Try:  
  
  
  
element.xpath(‘span’)[1].text  
  
  
  
🙂

---

<div class="post-metadata">

**Author:** ![ivar](https://avatars.discourse-cdn.com/v4/letter/i/51bf81/32.png) [@ivar](https://forums.plex.tv/u/ivar)\
**Post date:** [March 2, 2009, 11:16pm UTC](https://forums.plex.tv/t/beginners-question-xpath-element/1098/3 "2009-03-02T23:16:59Z")

</div>

Thanks for a quick reply. I should perhaps have mentioned that I tried that 🙂

```auto

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 10: ordinal not in range(128)

```

  
  
Could it perhaps be something with scandinavian characters? (åäö)

---

<div class="post-metadata">

**Author:** ![ivar](https://avatars.discourse-cdn.com/v4/letter/i/51bf81/32.png) [@ivar](https://forums.plex.tv/u/ivar)\
**Post date:** [March 3, 2009, 12:15am UTC](https://forums.plex.tv/t/beginners-question-xpath-element/1098/4 "2009-03-03T00:15:27Z")

</div>

element.xpath(‘span’)[1].text.encode(‘utf-8’) is tonights winner! 🙂

---

<div class="post-metadata">

**Author:** ![ivar](https://avatars.discourse-cdn.com/v4/letter/i/51bf81/32.png) [@ivar](https://forums.plex.tv/u/ivar)\
**Post date:** [March 3, 2009, 10:12am UTC](https://forums.plex.tv/t/beginners-question-xpath-element/1098/5 "2009-03-03T10:12:06Z")

</div>

> [@](#):
>
> Try:  
>   
>   
>   
> element.xpath(‘span’)[1].text  
>   
>   
>   
> 🙂

  
  
Thanks again, and by the way, where do I find documentation on this?

---

<div class="post-metadata">

**Author:** ![jam](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jam/32/186050_2.png) [@jam](https://forums.plex.tv/u/jam)\
**Post date:** [March 3, 2009, 10:22am UTC](https://forums.plex.tv/t/beginners-question-xpath-element/1098/6 "2009-03-03T10:22:43Z")

</div>

There isn’t any yet 🙂 Once the framework code’s been cleaned up & had a few more things added to it, we’ll be releasing full documentation with tutorials & code samples.

---

<div class="post-metadata">

**Author:** ![zakharm](https://avatars.discourse-cdn.com/v4/letter/z/df705f/32.png) [@zakharm](https://forums.plex.tv/u/zakharm)\
**Post date:** [March 3, 2009, 2:15pm UTC](https://forums.plex.tv/t/beginners-question-xpath-element/1098/7 "2009-03-03T14:15:55Z")

</div>

> [@](#):
>
> There isn’t any yet 🙂 Once the framework code’s been cleaned up & had a few more things added to it, we’ll be releasing full documentation with tutorials & code samples.

  
  
Hi Jam,  
I've seen a lot of useful posts from you on how to develop Plug-ins. Do you think you could pin a "Tips" only topic and we can start filling it in with tips?  
  
Thanks!

---

<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:23pm UTC](https://forums.plex.tv/t/beginners-question-xpath-element/1098/8 "2019-12-20T20:23:00Z")

</div>

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