This is a Python script using Flask web framework and BeautifulSoup library to scrape various websites for a given username. It creates a dictionary of URLs where the username is present and saves the results to a JSON file. The script contains a Flask endpoint to handle search requests with a GET parameter for the username. The URL for each website to be searched is stored in a dictionary. If the username is present in the response, it is added to the search results dictionary. The results are returned as a JSON response.
Before starting to work with the project, the following components must be installed:
Clone the repository to your local computer:
git clone https://github.com/scyberlife/multi-site-username-scraper
Install all dependencies:
pip install -r requirements.txt
Launch the application on MacOS & Linux:
python3 main.py
Launch the application on Windows:
python main.py
Then go to where 'USERNAME' is the username you want to find:
http://localhost:5000/search?username=<USERNAME>
The search results will be saved on the desktop in JSON format in the file search_results.json
{
"johndoe": [
"https://github.com/johndoe",
"https://www.tiktok.com/@johndoe",
"https://pikabu.ru/@johndoe"
]
}
Sergei Beliaev - Idea and development - scyberlife