Python PyAutoGUIを使ってスクリーンショット
PyAutoGUIをインストール
pip install pyautogui
スクリーンショット
import pyautogui
def main():
# 全体
screenshot = pyautogui.screenshot()
screenshot.save("/tmp/samp1.png")
# 範囲指定
screenshot = pyautogui.screenshot(region=(100, 200, 1500, 875))
screenshot.save("/tmp/samp2.png")
if __name__ == "__main__":
main()
結果
いいね!と思ったら LGTM お願いします
【PR】プログラミング新聞リリースしました! → https://pronichi.com
【PR】週末ハッカソンというイベントやってます! → https://weekend-hackathon.toyscreation.jp/about/