CSS 선택자

CSS 선택자로 HTML 요소나 필드를 추출합니다.

입력: 텍스트결과: 텍스트

텍스트 입력

도구 옵션

예제

Select a release download link by its class

The result contains the matching element, including its attributes.

입력

<main><a class="download" href="/app.tar.gz">Linux</a><a href="/notes">Notes</a></main>

Expected answer

<a class="download" href="/app.tar.gz">Linux</a>
CSS 선택자
a.download
구분자
\n
Select only failed rows from a job report

입력

<table><tr class="passed"><td>Build</td></tr><tr class="failed"><td>Test</td></tr></table>

Expected answer

<tr class="failed"><td>Test</td></tr>
CSS 선택자
tr.failed
구분자
\n
Select links whose destination uses HTTPS

입력

<div><a href="https://example.org/docs">Docs</a><a href="/local">Local</a></div>

Expected answer

<a href="https://example.org/docs">Docs</a>
CSS 선택자
a[href^="https://"]
구분자
\n
Select direct list children without nested checklist items

입력

<ul id="steps"><li>Build<ul><li>Compile</li></ul></li><li>Deploy</li></ul>

Expected answer

<li>Build<ul><li>Compile</li></ul></li> | <li>Deploy</li>
CSS 선택자
#steps > li
구분자
|
Find a missing canonical link in a document head

An empty result means no matching element was found in this supplied HTML; no website is fetched.

입력

<html><head><title>Release notes</title></head><body>v2</body></html>

Expected answer

Empty result
CSS 선택자
link[rel="canonical"]
구분자
\n
CSS selector

입력

<div id="test">
<p class="a">hello</p>
<p>world</p>
<p class="a">again</p>
</div>

Expected answer

<p class="a">hello</p>
<p class="a">again</p>
CSS 선택자
#test p.a
구분자
\n

매개변수

매개변수기본값입력 및 선택 항목
CSS 선택자""텍스트
구분자"\\n"\n, \r, \t 등의 이스케이프 시퀀스 지원

관련 도구

추출

작업 참고 자료

원본 기술 문서 보기 (English)