LoginSignup
2
4

More than 5 years have passed since last update.

環境構築メモ

Posted at

Webブラウザを自動で操作するプログラムを書くための前準備として、環境構築を行う。

今回導入する環境は以下の通り。
・エディタ
Visual Studio Code
・言語
Python
・ツール
chromedriver.exe
Microsoft WebDriver

手順

  1. DL
    上記リンクから全てをダウンロードする。

  2. VS Codeのインストール
    標準設定のまま、追加タスクの選択でチェックボックスがあるが、基本全選択でおk

  3. Pythonのインストール
    インストーラーを起動したら「Add to PATH」にチェックを入れてインストール

  4. VS Codeの設定

    1. Add-onでPythonの拡張機能をインストールする。
      1. CTRL+P から「ext install Python」と入力
      2. 一番インストールされている「Python」をインストール
    2. pylintのインストール。
      1. Ctrl+Shift+Cでコンソールを開く
      2. 「pip install pylint」と入力
      3. エンターでインストール実行
    3. seleniumのインストール。
      1. Ctrl+Shift+Cでコンソールを開く
      2. 「pip install selenium」と入力
      3. エンターでインストール
    4. 実行のコマンド化
      1. CTRL+P から「>tasks configure」と入力
      2. タスクの構成 > Others の順にクリック
      3. 出来上がった.vscodeファイルを以下に書き換える
tasks.json
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "0.1.0",
    "command": "python",
    "isShellCommand":true,
    "args": ["${file}"],
    "showOutput": "always"
}

最後に、ChromeDriver.exeをPythonのインストールフォルダに置いて完了
(デフォルトはこの位置 AppData\Local\Programs\Python\Python36-32)

2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4