beginners question: xpath element

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 :slight_smile:



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

Try:



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



:slight_smile:

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



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? (åäö)

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



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

There isn’t any yet :slight_smile: 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!

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