Skip to content
Yohan edited this page Jul 22, 2023 · 12 revisions

What is a CSS Selector? Please read https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors

In the CSS Selector Filter field, you enter the CSS Selector - not the HTML

So for example if the HTML is

<div class="points">
  <span id="interesting">
  57 points
  </span>
</div>

the selector would be .points #interesting

In this example

<span class="chapter lastchapter">
  Chapter 53
</span>

these three selectors will match : .chapter, .lastchapter, .chapter.lastchapter. This last one will only match when both CSS classes match. .chapter lastchapter is wrong in this case.

Select/extract just the HREF from <A> tag using xpath

if you have

<h3>
  <a href..></a>
</h3>

filter: //h3/parent::a//@href

Select all img "src" tag only with xPath filter

//img//@src

Select by data- source

<div data-test-id="productSizeList"...

//div[@data-test-id = 'productSizeList']

xPath and non-latin text getting garbled

xpath: type filters and non-UTF8 is incompatable, If you see that your text is garbled Нема планираних искључења. becomes Ð�ема планиÑ�Ð°Ð½Ð¸Ñ Ð¸Ñ�кÑ�Ñ�Ñ�еÑ�а. then you should convert your xPath filter to CSS https://extendsclass.com/xpath-to-css.html

For example #1546