UiPath Documentation
studiox
2023.10
false
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。
UiPath logo, featuring letters U and I in white

StudioX user guide

最終更新日時 2026年4月30日

チュートリアル: Web ページから表データを抽出し、Excel で編集する

このチュートリアルでは、ユーロ圏以外の国に対する本日のユーロの為替レートを収めた表を、欧州中央銀行の Web サイトから抽出するオートメーション プロジェクトを作成します。為替レートの履歴データが Excel スプレッドシートに保持されており、このデータを毎日追加していきます。Web サイトから抽出するデータの形式が Excel スプレッドシートの形式と異なっているので、抽出後のデータを Excel で編集し、適切な形式を適用する必要もあります。

We will create a project and start by adding a Use Excel File activity to indicate the Excel file to use. We will then click Data Extraction in the StudioX ribbon to start a wizard that will help us extract the data from the website. When we complete the wizard, two already configured activities will be added automatically to our project: a Use Application/Browser activity that indicates the web page and an Extract Table Data activity that extracts the data. We will then add a series of Excel activities to transpose the data, format the data as dates or numbers, and append the data to the worksheet with historical exchange rates.

  1. プロジェクトを設定し、必要なファイルを取得します。
    1. Create a new blank project using the default settings.
    2. このページ下部にあるボタンを使用して、オートメーション プロジェクトを収めたアーカイブをダウンロードして展開し、currency data.xlsx ファイルをプロジェクト フォルダーにコピーします。
    3. This example uses Google Chrome, which requires the UiPath® extension for Chrome to be installed. To install it, go to Home (StudioX Backstage View) > Tools, and then, under UiPath Extensions, click Chrome.
  2. Excel ファイルをプロジェクトに追加します。
    1. Click Add Activityドキュメントの画像 in the Designer panel, and then find the Use Excel File activity in the search box at the top of the screen and select it. A Use Excel File activity is added to the Designer panel.
    2. アクティビティで次の操作を行います。
      • Click Browse next to the Excel file field, and then browse to and select the file currency data.xlsx

      • [参照名] フィールドに「currency」と入力します。

        これで、このオートメーションでは名前を currency としたファイル currency data.xlsx を操作対象として指定したことになります。

  3. Web ページからデータを抽出します。
    1. StudioX で、リボンの [表抽出] をクリックして抽出ウィザードを開きます。

    2. Click Select Data to Extract to indicate the table from which to extract the data.

    3. マウス カーソルを移動して、StudioX で検出されたユーザー インターフェイス要素が強調表示される様子を確認します。テーブルの任意の場所にマウス カーソルを移動し、クリックします。たとえば、[Currency] という見出しをクリックします。

    4. StudioX は、表がクリックされたことを検出し、表全体からデータを抽出するかどうかを尋ねます。[はい] をクリックします。

    5. You can view a preview of the extracted table data by clicking the Preview button.

    6. You can select Extract data from multiple pages if the data spans multiple pages. Since that is not the case, select No.

      ウィザードが終了します。[アプリケーション/ブラウザーを使用] および [表データを抽出] アクティビティが追加されたプロジェクトが StudioX に表示されます。

    7. In the Extract Table Data activity, click Plusドキュメントの画像 on the right side of the Extract to field, and then select currency > Sheet1 [Sheet] to indicate that you want to copy the extracted data to Sheet1 of the currency Excel file.

  4. データに対して行/列の入れ換えと書式設定を行い、Historical Data シートにコピーします。
    1. Click Add Activityドキュメントの画像 below the Use Application/Browser activity, then find the Copy Range activity in the search box at the top of the screen and click it. The activity is added to the project.
    2. [範囲をコピー] アクティビティで、次の操作を行います。
      • Click Plus on the right side of the Source field, and then select currency > Indicate in Excel.

      • Excel ファイルの Sheet1 を選択し、範囲 A2:C33 (Web ページから抽出したデータの見出し行を除いた部分の範囲) を選択します。つづいて Excel のリボンの [UiPath] タブで [Confirm (確定)] をクリックします。

        これで、currency ファイルの Sheet1 の範囲 A2:C33 をコピーするように指定したことになります。

      • Click Plus on the right side of the Destination field, and then select currency > Indicate in Excel.

      • Excel ファイルの Sheet2 を選択し、セル B1 を選択します。つづいて、Excel のリボンの [UiPath] タブで [Confirm (確定)] をクリックします。

        これで、currency ファイルの Sheet2 のセル B1 から始まる領域にデータを貼り付けるように指定したことになります。

      • [コピーする内容] ドロップダウン メニューの [すべて] を選択します。

      • [行/列の入れ替え] を選択して、貼り付け先でデータの行と列を入れ替えるように指定します (列を行に、行を列にして貼り付け)。

    3. Click Add Activityドキュメントの画像 below the Copy Range activity, then find the Format Cells activity in the search box at the top of the screen and click it. The activity is added to the project.
    4. [セルを書式設定] アクティビティで、次の操作を行います。
      • Click Plus on the right side of the Source field, and then select currency > Indicate in Excel.

      • Excel ファイルの Sheet2 を選択し、為替レートが入力された 3 行目全体を選択します。Excel のリボンの [UiPath] タブで [Confirm (確定)] をクリックします。

      • [書式設定] をクリックします。[データの種類] タブを選択し、[分類] ドロップダウン メニューから [数値] を選択します。[小数点以下] ボックスに「2」と入力して、[桁区切り ( , ) を使用] を選択します。

        これにより、Sheet2 の行 3 のデータを、桁区切りを使用した小数点以下 2 桁の数値として書式設定するように指定したことになります。

    5. 前のアクティビティの下に、2 番目の [セルを書式設定] アクティビティを追加します。
    6. 2 番目の [セルを書式設定] アクティビティで、次の操作を行います。
      • Click Plus on the right side of the Source field, and then select currency > Indicate in Excel.

      • Excel ファイルの Sheet2 を選択し、セル A3 を選択します。つづいて、Excel のリボンの [UiPath] タブで [Confirm (確定)] をクリックします。

      • [書式設定] をクリックします。[データの種類] タブを選択し、[分類] ドロップダウン メニューから [日付] を、[日付形式] ドロップダウン メニューから [3/14/2012] を選択します。

        これにより、Sheet2 のセル A3 のデータを、d/mm/yyyy の日付形式として書式設定するように指定したことになります。これは、今日の日付を追加するセルです。

    7. Click Add Activityドキュメントの画像 below the second Format Cells activity, then find the Write Cell activity in the search box at the top of the screen and click it. The activity is added to the project.
    8. [セルに書き込み] アクティビティで、以下の手順を実行します。
      • Click Plus on the right side of the What to write field, and then select Project Notebook (Notes) > Date [Sheet] > Today [Cell].

      • Click Plus on the right side of the Where to write field, and then select currency > Indicate in Excel.

      • Excel ファイルの Sheet2 を選択し、セル A3 を選択します。つづいて、Excel のリボンの [UiPath] タブで [Confirm (確定)] をクリックします。

        これで、currency ファイルの Sheet2 のセル A3 にプロジェクト ノートブックから今日の日付をコピーするように指定したことになります。

    9. Click Add Activityドキュメントの画像 below the Write Cell activity, then find the Append Range activity in the search box at the top of the screen and click it. The activity is added to the project.
    10. [範囲を追加] アクティビティで、以下の手順を実行します。
      • Click Plusdocs image on the right side of the Excel range to append field, and then select currency > Indicate in Excel.
        • Excel ファイルの Sheet2 を選択し、3 行目全体を選択します。Excel のリボンの [UiPath] タブで [Confirm (確定)] をクリックします。

          これで、Sheet2 の行 3 のデータをコピーし、currency ファイルの Historical Data シートの既存データの後に追加するように指定したことになります。

        • Click Plusdocs image on the right side of the Append after range field, and then select currency > Historical Data [Sheet]. * From the What to copy drop-down menu, select All. * Leave Transpose deselected, since we don't need to transpose the data.

    11. Click Save in the StudioX ribbon to save the automation, then click Run to execute the automation.The web page is opened, the exchange rates are copied to Excel where they are formatted and added to the Historical Data sheet. Download example

このページは役に立ちましたか?

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得