Chromeのコンソールやっぱ便利
ほしいなと思って調べてみるとあるもんですね
今回は、ある商品の入荷情報を取得する
![](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F69007%2Fac1097fb-a9d2-67af-849e-cc629b73f336.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=8bbb82f7fc841721592babe972b67bd8)
取得対象はこちら
![](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F69007%2F90fd354d-57a8-2baf-e805-43d1a0bc57f0.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=034c9c106ec8a94425901307cf999f64)
構造を見るとこうなので
$x('//div[@id="availability"]/span')
Chromeのコンソールでこのように入力してみる
![](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F69007%2Fa111e938-0afb-cb8b-db7c-44ae62698af9.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=4afcb5cab615a48113521d019835a0d9)
やったぜ!対象が取得できました。
参考
Testing XPath in Google Chrome browser
Go to list of users who liked
More than 5 years have passed since last update.
Chromeのコンソールやっぱ便利
ほしいなと思って調べてみるとあるもんですね
今回は、ある商品の入荷情報を取得する
取得対象はこちら
構造を見るとこうなので
$x('//div[@id="availability"]/span')
Chromeのコンソールでこのように入力してみる
やったぜ!対象が取得できました。
Testing XPath in Google Chrome browser
Register as a new user and use Qiita more conveniently
Go to list of users who liked