This project automates interactions with perplexity-ai on the perplexity.ai website using selenium 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.
perplexity.kirpildi.mp4
Tested in Python 3.11.2 on linux
To get started, you'll need to install the following Python packages:
pip install selenium beautifulsoup4 markdownify
- 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
response_to_markdown/output.md
file.
- Crossplatform - Windows, Linux
The primary goal of this tool is to streamline and automate interactions with perplexity-ai, making it faster and more efficient.
-
Clone the repository:
git clone https://github.com/HTTPS-Miner/perplexity-ai cd perplexity-ai
-
Create a virtual environment:
python3 -m venv myenv source myenv/bin/activate
-
Install the required dependencies:
pip install selenium beautifulsoup4 markdownify
-
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
If you want to avoid opening the browser window, simply uncomment line 13 in main.py to perform the operation without opening the browser.
py -m venv myenv
myenv\Scripts\activate.bat
Update Firefox path:
Open main.py and modify line 11 to set the correct path for Firefox: Example:
options.binary_location = "C:\\Program Files\\Mozilla Firefox\\firefox.exe"