├── README.md ├── bot.py └── requirements.txt /README.md: -------------------------------------------------------------------------------- 1 | # MeproBot 2 | 3 | MeproBot is an automated task completion bot built with Selenium and Python. It includes a time change feature, allowing tasks to be executed at specific intervals or times. 4 | 5 | # Download 6 | 7 | [Download Latest Version](https://github.com/ai-man-codes/meproBot/releases/latest/download/meproBot.exe) 8 | 9 | ## Features 10 | 11 | - Automates all tasks using Selenium. 12 | - Adjusts task execution time dynamically. 13 | - Simple to set up and run. 14 | 15 | ## Installation 16 | 17 | To install and run MeproBot, follow these steps: 18 | 19 | ### 1. Clone the Repository 20 | 21 | ```sh 22 | git clone https://github.com/ai-man-codes/meproBot.git 23 | ``` 24 | 25 | ### 2. Navigate to the Project Directory 26 | 27 | ```sh 28 | cd meproBot 29 | ``` 30 | 31 | ### 3. Install Dependencies 32 | 33 | Ensure you have Python installed, then install the required dependencies: 34 | 35 | ```sh 36 | pip install -r requirements.txt 37 | ``` 38 | 39 | ### 4. Run the Bot 40 | 41 | Execute the bot with: 42 | 43 | ```sh 44 | python bot.py 45 | ``` 46 | 47 | ### 5. Browser Execution 48 | 49 | - Navigate to Learning Modules > My Tasks. 50 | - Click on the task and wait for 5 seconds. 51 | - The bot will proceed automatically. 52 | 53 | ## Requirements 54 | 55 | - Python 3.x 56 | - Selenium 57 | - Webdriver Manager 58 | - Google Chrome (latest version recommended) 59 | 60 | ## Author 61 | 62 | Developed by Ai-man. 63 | 64 | -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from selenium.webdriver.chrome.service import Service 3 | from selenium.webdriver.chrome.options import Options 4 | from webdriver_manager.chrome import ChromeDriverManager 5 | 6 | import requests 7 | import random 8 | import json 9 | import time 10 | import sys 11 | 12 | print("\t\tmeproBot by Ai-man\n") 13 | 14 | URL_LOGIN = "https://mepro.pearson.com/login" 15 | URL_PostActivityLogDetails = "https://mepro.pearson.com/CallToServer.aspx/PostActivityLogDetails" 16 | 17 | chrome_options = Options() 18 | chrome_options.set_capability("goog:loggingPrefs", {"performance": "ALL"}) 19 | 20 | service = Service(ChromeDriverManager().install()) 21 | driver = webdriver.Chrome(service=service, options=chrome_options, keep_alive=True) 22 | 23 | driver.get(URL_LOGIN) 24 | 25 | def send_answer(request_urls: list): 26 | if URL_PostActivityLogDetails in request_urls: 27 | cookie = str(driver.get_cookie("ASP.NET_SessionId")['value']) 28 | 29 | cookies = { 30 | "ASP.NET_SessionId": cookie, 31 | } 32 | 33 | headers = { 34 | "Content-Type": "application/json", 35 | "Cookie": f"ASP.NET_SessionId={cookie}" 36 | } 37 | 38 | post_data = { 39 | "obj": { 40 | "ActivityScore": random.randrange(85, 100), 41 | "ActivityStatus": "completed", 42 | "TimeSpent": f"00:{random.randrange(2, 10)}:{random.randrange(0, 59)}", 43 | "ActivityScoreDetailsList": [ 44 | {"SkillName": "Reading", "Minimum": 70, "Maximum": 100, "SkillScore": random.choice([75, 100])}, 45 | {"SkillName": "Listening", "Minimum": 70, "Maximum": 100, "SkillScore": random.choice([75, 100])}, 46 | {"SkillName": "Vocabulary", "Minimum": 70, "Maximum": 100, "SkillScore": random.choice([75, 100])}, 47 | {"SkillName": "Grammar", "Minimum": 70, "Maximum": 100, "SkillScore": random.choice([75, 100])}, 48 | ], 49 | } 50 | } 51 | 52 | # post_data = { 53 | # "obj": { 54 | # "ActivityScore": random.randrange(85, 100), 55 | # "ActivityStatus": "completed", 56 | # "TimeSpent": f"00:{random.randrange(2, 10)}:{random.randrange(0, 59)}" 57 | # } 58 | # } 59 | 60 | time.sleep(2) 61 | 62 | response = requests.post(URL_PostActivityLogDetails, headers=headers, cookies=cookies, json=post_data) 63 | print(f"\nstatus code : {response.status_code}") 64 | print("This Task is done !") 65 | 66 | 67 | def main(): 68 | try: 69 | while True: 70 | logs = driver.get_log("performance") 71 | 72 | for entry in logs: 73 | log_msg = json.loads(entry["message"]) 74 | 75 | if log_msg["message"]["method"] == "Network.requestWillBeSent": 76 | request_urls = log_msg["message"]["params"]["request"]["url"] 77 | 78 | send_answer(request_urls) 79 | 80 | except KeyboardInterrupt: 81 | driver.quit() 82 | sys.exit() 83 | 84 | if __name__ == "__main__": 85 | main() 86 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | selenium 2 | webdriver-manager --------------------------------------------------------------------------------