A simple Python script to detect mixed content in URLs using requests
and BeautifulSoup
.
Mixed content occurs when an HTTPS website references insecure (HTTP) resources. Browsers prevent an HTTPS website from loading most insecure resources to maintain the security of the page. This script helps identify and fix or replace mixed content, ensuring your website remains secure.
- Efficiently detects mixed content in given URLs.
- Uses the power of
requests
andBeautifulSoup
for web scraping. - Easy to use and integrate into existing workflows.
-
Clone the repository:
git clone https://github.com/assafv/isMixedContent.git cd isMixedContent
-
Create a virtual environment (optional but recommended):
python3 -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a text file named
urls.txt
and populate it with the URLs you want to check, each on a new line. -
Run the script:
python detect_mixed_content.py
Here's an example of how to use the script:
-
Add URLs to
urls.txt
:https://example.com https://anotherexample.com
-
Run the script:
python detect_mixed_content.py
-
The script will output any mixed content found in the URLs provided.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.