このセクションでは、CSS セレクタを使用する方法と同様に、XPath セレクタを使用して、指定されたHTML DOM Element Object(https://www.w3schools.com/jsref/dom_obj_all.asp)
内の複数の要素をキャプチャする方法を学びます(https://www.w3schools.com/xml/xpath_syntax.asp
) 。
OpenRPAを開き、Recorderボタンをクリックします。次に、ページ内の要素をクリックします。

新しいGetElementActivityの中のSequenceから
Click ElementActivityを削除する。

ここで、ユーザーは「セレクタを開く」ボタンをクリックする必要があり、セレクタ デザイナーが
表示されます。

これで、ユーザーはxpath
パラメーターの一部だけを切り取ることができます。xpath
パラメーターのdiv[3]/div/div[2]/div/span の
部分文字列をdiv[*]/div/div[2]/div/span
に置き換えるのです。これにより、OpenRPAは10個の
検索要素をすべて捕捉することができます。
この後、ユーザーはOkボタンをクリックしてSelector Designerを
終了することができます。


Recorderで生成されたIE/NM.GetElementActivity内のSequenceに
WriteLineActivityをドラッグして、そのText
入力フィールドにitem.Textの
値を代入することで動作確認ができるようになりました。

ワークフローを実行すると、検出された10個のスパン
要素が正常に取り込まれたことが確認できます。
