Question: How can I hide all elements containing another element with a particular class ?

```
<div class="aa">
    Text 1 <span class="hideme">Show this !</span>
</div>
<div class="aa">
    Text 2
</div>
<div class="aa">
    Text 3
    <span class="qqq">Show this !</span>
</div>

```

In the above example the second and third div should be hidden and the first div (with "Text 1") with class bb, not just the span. And Text 3 should still be hidden as it is class .qqq instead of .hideme. It appears that :contains ignores classes and only works on plain text.

`$(".aa :not(:contains .hideme)".hide();`  hides *all* div's instead of only the div containing .hideme.

Answer: 
```
 video_list = driver.find_elements_by_xpath('//a[@class="style-scope ytd-video-renderer"]')
video_url = [video_list.get_attribute('href').replace('https://www.youtube.com', '') for video_list in video_list]
print(video_url)

for index, channel in enumerate(video_url):
    if channel == channel_id:
        print(index)

```

Here `channel_id` is nothing but `/channel/UC8butISFwT-Wl7EV0hUK0BQ` for the channel name `freeCodeCamp.org`.

1. First line gives all the element of `a` tag
2. From a list of step 1, find the `href` element. It will give you the complete URL for e.g. `https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ`. so replacing `https://www.youtube.com` and extracting into `video_url`
3. Enumerate with `video_url` and print the `index`
You are using wrong locators.  

Try this:

```
video_list = driver.find_elements_by_xpath("//div[@id='channel-info']//a[@class='yt-simple-endpoint style-scope yt-formatted-string']")

```

**UPD**  

After your explanation I understand a bit more.  

You can find those specific elements with this:

```
//div[@id='channel-info']//a[@class='yt-simple-endpoint style-scope yt-formatted-string' and (contains(@href,"/channel/UC8butISFwT-Wl7EV0hUK0BQ"))]

```

This will give you 2 elements since there are 2 videos from that channel in that search results