This project automates interactions with ChatGPT on the ChatGPT.com website using undetected-geckodriver and Firefox. The script allows you to send text input from a file, receive the response from ChatGPT, and save it to an output file — all without manually opening a browser.
chatgpt.mp4
Tested with Python 3.11.2
To get started, you'll need to install the following Python packages:
pip install undetected-geckodriver beautifulsoup4 html2text
- Firefox
- Python >= 3.6
- Selenium >= 4.10.0
- Psutil >= 5.8.0
- Input File: Create a file called
prompt.txt
and write your message to ChatGPT. - Output File: The response from ChatGPT will be saved in the
output.md
file.
- Operating System: This tool is designed to run on Linux only.
- Browser: Firefox is required to run this script using undetected-geckodriver.
The primary goal of this tool is to streamline and automate interactions with ChatGPT, making it faster and more efficient.
-
Clone the repository:
git clone https://github.com/HTTPS-Miner/chatgpt cd chatgpt
-
Create a virtual environment:
python3 -m venv myenv source myenv/bin/activate
-
Install the required dependencies:
pip install undetected-geckodriver beautifulsoup4 html2text bs4
-
Create a
prompt.txt
file in the current directory and write the message you want to send to ChatGPT. -
To run the tool:
python3 main.py prompt.txt
If you want to avoid opening the browser window, simply uncomment line 12 in main.py to perform the operation without opening the browser.