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)