Automate interactions with DeepSeek AI using Selenium and Python.
This script logs into DeepSeek, sends messages, retrieves responses, and saves conversation history.
✔ Automated Login: Logs into DeepSeek using stored credentials.
✔ DeepThink Mode: Supports optional DeepThink (R1) mode.
✔ Message Automation: Sends multiple messages and collects responses.
✔ Dynamic Response Handling: Waits until the AI finishes responding.
✔ Response Saving: Stores responses in a text file.
✔ Headless Mode Support: Runs without a visible browser.
git clone https://github.com/ziadwaelai/DeepSeek-Automator.git
cd deepseek-automatorEnsure you have Python 3.11+ installed. Then install required libraries:
pip install -r requirements.txtCreate a config.ini file in the project root:
[credentials]
Email = your-email@example.com
Password = yourpasswordpython deepseek_automator.pyfrom deepSeek_automator.handler import DeepSeekAutomator
bot = DeepSeekAutomator(deepThink=True, headless=True, saveResponses=True)
bot.login()
response = bot.send_message("What is the capital of France?")
print(response)
bot.save_conversation_history("conversation.txt")
bot.close()When initializing DeepSeekAutomator:
| Parameter | Type | Default | Description |
|---|---|---|---|
deepThink |
bool |
False |
Enables DeepThink (R1) mode. |
uc |
bool |
True |
Uses undetectable Selenium mode. |
headless |
bool |
False |
Runs browser in headless mode. |
saveResponses |
bool |
True |
Saves responses to a file. |
- Loads credentials from
config.ini. - Handles login elements dynamically.
- Sends messages to DeepSeek AI.
- Waits for the full response (
<RESPONSE WAS FINISHED>). - Saves responses automatically.
- Extracts both user prompts & AI responses.
- Saves conversations as:
Q: What is AI? A: Artificial Intelligence (AI) is...
- Enables DeepThink (R1) with
deepThink=True.
- Runs without opening a visible browser.
Login successful
Message sent: What is the capital of France?
Current Response: The capital of France is Paris. <RESPONSE WAS FINISHED>
Full response detected!
Q: What is the capital of France?
A: The capital of France is Paris.
Conversation saved to conversation.txt
❌ Bot is stuck waiting for a response?
✔ Increase the timeout value in wait_for_response().
❌ DeepThink (R1) button is not clicking?
✔ Check if the button XPath has changed.
❌ Wrong login credentials?
✔ Ensure config.ini is set up correctly.
For support, reach out to:
📧 Email: ziadwael142@gmail.com