From aa7ec5f9b990fbd815aadafcfa1da465bdd19682 Mon Sep 17 00:00:00 2001 From: Viddesh1 Date: Tue, 6 Jun 2023 13:43:46 +0530 Subject: [PATCH] Added Python program to take screen capture using scroll bar so manual work can be reduce --- Scripts/Scroll_Screen_Capture.ipynb | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Scripts/Scroll_Screen_Capture.ipynb diff --git a/Scripts/Scroll_Screen_Capture.ipynb b/Scripts/Scroll_Screen_Capture.ipynb new file mode 100644 index 0000000..95c3af8 --- /dev/null +++ b/Scripts/Scroll_Screen_Capture.ipynb @@ -0,0 +1,45 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# pip install PyAutoGUI==0.9.53\n", + "import pyautogui\n", + "\n", + "# To get the current position of the scrollbar drag the mouse pointer to respective scrollbar.\n", + "current_position = pyautogui.position()\n", + "\n", + "for i in range(1, 1000):\n", + " print(current_position.x, current_position.y) # Prints the pointer location in x - y position." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pyautogui\n", + "\n", + "\n", + "for i in range(0, 4): \n", + " image = pyautogui.screenshot()\n", + " image.save(\"image_\" + str(i) + \".png\")\n", + " # pyautogui.click()\n", + " pyautogui.moveTo(1361, 352) # Replace pyautogui.moveTo(X, Y) with your scrollbar co-ordinates\n", + " pyautogui.scroll(-1000)" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +}