Help us understand the problem. What is going on with this article?

Chrome, Firefox, Edge で xpath の取得

More than 1 year has passed since last update.

Seleniumでよく使うxpathの取得・検証

現状は chrome が一番便利かなーという感じでしょうか

Chrome

  1. F12 を押してデベロッパーツールを開く
  2. Ctrl + f で検索枠を開く
  3. xpath を直接入力
  4. 取得できると Element の箇所がハイライトされる

コンソールから $x('//input') で xpath を指定してもできますが
箇所がハイライトされた方が分かりやすいです

Firefox

  1. F12 を押して開発者ツールを開く
  2. インスペクタで対象箇所を右クリック、コピー -> xpath でXPATHがコピーできる
  3. Esc を押してコンソールペインを開く
  4. $x('//xpath') で内容が取得できる

Edge

ドキュメントではコンソールに $x('//xpath') で取得できるとあるが
実行すると そんな関数は undefined だと怒られるので、現状できないようです (Windows10 1709)

Edge Documentation-DevTools-Console:Command Line

a__i__r
Software Developer Infrastructure Engineer
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした