Z
Z
zahar_922019-05-19 19:37:42
HTML
zahar_92, 2019-05-19 19:37:42

How to exclude div with display none?

Hello!
How to exclude div with attribute display: none; in XPath?
Structure:

<div class="bx_slider_conteiner" id="bx_117848907_245_slider_cont_548" style="display:  ;">
  <div class="bx_slider_scroller_container">
  <div class="bx_slide">
  <ul id="bx_117848907_245_slider_list">
  <li><span><span></span></span></li>
  <li><span><span></span></span></li>
  </ul>
  </div>
  </div>
</div>
<div class="bx_slider_conteiner" id="bx_117848907_361_slider_cont_548" style="display: none;">
  <div class="bx_slider_scroller_container">
  <div class="bx_slide">
  <ul id="bx_117848907_361_slider_list">
  <li><span><span></span></span></li>
  <li><span><span></span></span></li>
  </ul>
  </div>
  </div>
</div>

Both have the display style, only one has none. Suggested this option
//div[not(contains(@style, 'none'))]/ul[contains(@id, 'bx_')][contains(@id, '_')][contains(@id, '_slider_list')]/li/span/span

But it doesn't work. Maybe there are other options?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ilya, 2019-05-19
@zahar_92

The block confuses me
because this code is not in the html shown above.

S
Sergey Kotov, 2019-05-19
@liqrizz

.bar:nth-child(2){
display: none;
}
/**/
.bar:last-child{
display: none;
}

R
Roman Fov, 2019-05-20
@Roman-Fov

there you have a problem at the very beginning of the request
. Namely, here:
They wanted to cut off the hidden .bx_slider_conteiner with this, but in fact it selects not them, but .bx_slide
Hence this whole song

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question