0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

指定したリンクからクロームを起動してスクリーンショットをとっていくPGM

Posted at

指定したURLリストからクローム起動して、スクリーンショットを取っていくPGMです。
起動時には他のクロームが起動していないで動作させるようにします.

  1. 参考サイト
PowerShellでSendKeysを使ってみた - Qiita 【PowerShell】指定した期間動作を一時停止する | ほそぼそプログラミング日記 WindowsPowerShellをつかって連続作業 – みたホーム,iPhone,Lineスタンプ,猫,写真,格安SIM,暦,閏年,雑記

ソースコード

2.chromeSousa.ps1



# スクリーンショットをとるリンクのリスト
$linkList = @("http://hooktail.sub.jp/mathInPhys/intro/",
"http://hooktail.sub.jp/mathInPhys/kainokoshiki/"
);
for($i=0; $i -lt $linkList.Count; $i++ ){
$url = $linkList[$i];
$ps = Start-Process chrome.exe -ArgumentList $url -PassThru
#クローム起動するまで待ち
Start-Sleep -Seconds 3

[System.Windows.Forms.SendKeys]::SendWait(“{F12}”);
#デバックモードになるまで待ち
Start-Sleep -Second 5

#Ctrl+Shift+p
[System.Windows.Forms.SendKeys]::SendWait("^+p")
[System.Windows.Forms.SendKeys]::SendWait("full")
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
#スクリーンショット取り終わるまで待ち
Start-Sleep -Second 5

Stop-Process -Id $ps.Id

}

0
2
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
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?