Xpath

//a[@id=’link1′]/@href

//a[contains(@href,’B07SRLRS4M’)]

//a[not(contains(@href,’B07SRLRS4M’))]

//a[not(contains(@href,’B07SRLRS4M’)) and contains(@id,’link1′)]

//a[contains(@href,’B07SRLRS4M’) or contains(@id,’link1′)]

//a[starts-with(@href, “http://www.amazon.co.jp/”)]

//a[ends-with(@href, “96B”)]

//a[contains(text(), “NumPy”)]

//ul[@class=”book”]/li

//ul[@class=”book”]/li[2]
//ul[@class=”book”]/li[position()=2 or position()=3]

//ul[@class=”book”]/li[position()=last()]
//ul[@class=”book”]/li[position()=1]

//ul[@class=”book”]/li[position()>1]

//a[@id=”link2″]/parent::p

//a[@id=”link2″]/parent::node()

//a[@id=”link2″]/ancestor::node()
//a[@id=”link2″]/ancestor-or-self::node()

//a[@id=”link2″]/preceding::node()
//a[@id=”link2″]/preceding-sibling::node()

//p[@class=”recent books”]/child::node()

//p[@class=”recent books”]/following::node()
//p[@class=”recent books”]/following-sibling::node()

//p[@class=”recent books”]/descendant::node()
//p[@class=”recent books”]/descendant-or-self::node()

//p[@class=”recent books”]/self::node()

//p[@class=”recent books”]/attribute::node()

Xpath
//div[contains(@class,”productListTile”)]
CSS
div.productListTile

//div[contains(@class, “pName”)]/p/text()

div.pName > p ::text

//div[contains(@class, “pName”)]/p[2]/text()

div.pName > p + p::text

//span[@class=”productPrice”]/text()

span.productPrice::text

//a[@class=”next”]/@href

a.next::attr(href)

シェアする

  • このエントリーをはてなブックマークに追加

フォローする