【Puppeteer実用講座】Wine/Conoha VPS(Linux)にKabuステーションが入らなくなったのでPuppeteerで操作を代替する
※ 当ページには【広告/PR】を含む場合があります。
2025/05/06
2025/07/05

「Puppeteer」
新しいKabuステーションをWineで動かすときの問題点
「ClickOne形式(.appref-ms)」
Microsoft Edge WebView2 Runtime
setup.exe
[kabuステーション起動]

setup.exe

.ssh/config
$ scp ファイル <SSHの送り先>:~/
my-conoha
$ cd ダウンロード
$ ls
setup.exe
$ scp setup.exe my-conoha:~/
setup.exe 100% 860KB 1.8MB/s 00:00

$ wine setup.exe
00c0:fixme:wineusb:query_id Unhandled ID query type 0x5.
00c0:fixme:wineusb:query_id Unhandled ID query type 0x5.
00c0:fixme:wineusb:query_id Unhandled ID query type 0x5.
0024:err:winediag:ntlm_check_version ntlm_auth was not found. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
0024:err:ntlm:ntlm_LsaApInitializePackage no NTLM support, expect problems
0024:fixme:heap:RtlSetHeapInformation HEAP_INFORMATION_CLASS 1 not implemented!
0024:err:richedit:ReadStyleSheet skipping optional destination
winediag:SECUR32_initNTLMSP
$ sudo apt remove winbind && sudo apt install winbind -y
richedit:ReadStyleSheet
$ wine setup.exe
webview2
PuppeteerでSBI証券サイト(バックアップサイト)のオペレーションを自作


Debianインスタンスで最新のNodejsを「n」でインストール
$ sudo apt install -y nodejs npm
$ node --version
v18.19.2
「n」
$ sudo npm install n -g
$ sudo n stable
$ sudo apt purge -y nodejs npm
$ node --version
v22.15.0
$ node --version
-bash: /usr/bin/node: No such file or directory
n
#ターミナルエミュレータがbash/zsh/ash/dash/kshの場合
$ hash -r
#ターミナルエミュレータがcsh/tcshの場合
$ rehash
「n」でインストールバージョンを選択する
Error: The module '/*********/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 137. This version of Node.js requires
NODE_MODULE_VERSION 120. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
#....
Node.js v22.15.0
$ n ls-remote
Listing remote... Displaying 20 matches (use --all to see all).
24.3.0
24.2.0
24.1.0
24.0.2
24.0.1
24.0.0
23.11.1
23.11.0
23.10.0
23.9.0
23.8.0
23.7.0
23.6.1
23.6.0
23.5.0
23.4.0
23.3.0
23.2.0
23.1.0
23.0.0
--all
v23.11.1
$ sudo n 23.11.1
24.3.0
#👇ここでは sudo n 24.3.0 と同じ
$ sudo n latest
$ sudo n
#👇インタラクティブモード(対話モード)で管理
node/21.6.1
node/22.17.0
ο node/24.3.0
Use up/down arrow keys to select a version, return key to install, d to delete, q to quit
Chrome for Testをインストール
$ sudo apt install chromium
$ which chromium
/usr/bin/chromium
#puppeteerに対応したchromeをキャッシュする
$ sudo npx puppeteer browsers install chrome
/<ユーザー名>/.cache/puppeteer/
ログイン機能とCLI機能の導入
まとめ
記事を書いた人
ナンデモ系エンジニア
主にAngularでフロントエンド開発することが多いです。 開発環境はLinuxメインで進めているので、シェルコマンドも多用しております。 コツコツとプログラミングするのが好きな人間です。
カテゴリー