LoginSignup
0
0

More than 1 year has passed since last update.

Xpath記述、健忘録用

Last updated at Posted at 2023-05-30

要素の最後
/div[@id='aaa']/a[position()=last()]

テーブルの項目名で指定
//table[@class='aaa']//tr/td[preceding-sibling::th='お肉']

dl/ddタグの場合
//div[@class='aaa']//dl/dd[preceding-sibling::dt='お魚']

テキストで取得
//a/text()

要素を取得
//input[@name='aaaa']/@value
//input[@class='aaaa']/@href

ディスクリプションを取得
//meta[@name='description']/@content

特定の文字を含む
//a[contains(@class, 'aaaa')]/@href

and o notも使えるらしい
//a[contains(@href,"S_20") and contains(@href,"pdf")]

※後日整える予定

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0