WEBスクレイピングでテーブルの特定のテキストを取得

Webサイトからデータスクレイピングでテーブルの中の特定のテキストを取得したいですが、テーブル全体が取得されてしまいます。第2要素がないので、テーブル全体の要素を取得するしかないのですが、別の方法やデータ定義のコード編集で解決可能でしょうか?

下記idやclassなど削ってますが、こんな構成です。

   <table>
    <tbody><tr>
        <th>
            ★取得したいテキスト★<span class="essential flt_right">必須</span>
            <p style="font-size: 0px;" uipath_custom_id="23">
                                </p>
        </th>
        <td uipath_custom_id="8">
                <p>AAAAAA
                </p>
        </td>
    </tr>
    <tr>
        <th>
            ★取得したいテキスト2★
            <p>
                </p>
        </th>
        <td>

BBBB

ご教授お願いいたします。

「属性を取得」アクティビティでも特定のテキストが取得できます。

1 Like
<table class="input mgn0" uipath_custom_id="12" data-uipath-common-parent="" data-uipath-top-container="">
    <tbody uipath_custom_id="11" data-uipath-top-container=""><tr uipath_custom_id="10">
        <th uipath_custom_id="21">
           ★取得したいテキスト★<span class="essential flt_right">必須</span>
            <p style="font-size: 0px;" uipath_custom_id="23">
                                <span class="ic-pt-mini" style="display: inline-block;"><i class="ic-pt ic-pt-hp"></i></span><span class="ic-pt-mini" style="display: inline-block;"><i class="ic-pt ic-pt"></i></span><span class="ic-pt-mini" style="display: inline-block;"></span></p>
        </th>
        <td uipath_custom_id="8">
            
            

                                    </td>
    </tr>
    <tr uipath_custom_id="122">
        <th uipath_custom_id="5">
            ★取得したいテキスト2★
            <p uipath_custom_id="6" style="font-size: 0px;">
                        </p>
        </th>
        <td uipath_custom_id="1">
                        
</td>
    </tr>
    <tr uipath_custom_id="123">
        <th>
            </th>
        <td uipath_custom_id="2">
            
                    </td>
    </tr>
    <tr uipath_custom_id="124">
        <th>
                        </th>
        <td uipath_custom_id="17">
            
                                </td>
    </tr>
</tbody></table>

こんにちは

通常の手順で2つめの要素を指定して取得できそうですが、環境がことなりそうでしょうか...
(意図が異なりますでしょうか?)

1 Like

ありがとうございます。
「属性を取得」アクティビティで設定する属性が分からないのですが、
属性選択で選べるものの解説が記載されているページなどありますでしょうか?
検索してみましたが、分かるものに出会えず。。

ありがとうございます。
★取得したいテキスト2★
を2番目の要素に設定すると
データプレビューの中身が空で表示されてしまいました。

同じページの別のテーブル要素を2番目に設定しても同じ症状です。

何が引っかかっているのやら。。。

Ui Explorerで属性と取れる値が確認できます。
テキストの場合は、"aaname"か"innertext"を指定してみてください。