Xpath question

There is an older/abandoned channel that has a portion broken.
I narrowed it down to this

name = channel.xpath(’.//strong’)[0].text

and then further down in code it puts it in a list

It’s trying to pull channel name between multiple class=‘play’>CNBC
. class=‘play’>ABC

, etc
But in the mix of the html scrape are a few



So it errors out when it tries to add … to the list.
Any ideas on how better code this ?

I'd try ".//div[@class='play']/strong" but this may or may not work depending on what element is in the channel variable. I also assumed the element with class='play' is div, if it's not, edit the expression accordingly or use asterisk (*) to match any tag name.

You can check the value the xpath query finds and continue the loop if the value is "...".

name = channel.xpath('.//strong')[0].text

if name == “…”:
    continue

Thanks guys got it working using a mix of both.   

name = page.xpath(".//a[@class='play']/strong")[n].text
        oc.add(DirectoryObject(key = Callback(GuideSubMenu, title=name, data=String.Encode(show_info)), title=name, thumb=R(name + '.jpg')))
        if name != "...": n = n + 1
else: n = n + 2