This is a basic Python script that demonstrates web scraping using the BeautifulSoup library. It retrieves and parses the HTML content of a specified website, selects specific HTML tags, and extracts their content or attributes.
Disclaimer: The code provided in this repository is for educational purposes only. The authors do not assume any responsibility for how it is used or any consequences of its use. The users of this code are solely responsible for complying with all legal requirements and ethical guidelines related to web scraping.
- Clone the repository to your local machine.
git clone https://github.com/TitanHaxz/Python-Web-Scraping.git
- Navigate to the project directory.
cd web-scraping
- Install the required dependencies using pip.
pip install beautifulsoup4
pip install requests
- Run the script.
python web_scraping.py
- Enter the URL of the website when prompted.
Enter the URL of the website: https://www.example.com
- The script will send an HTTP request to the specified URL, retrieve the HTML content, parse it, select the desired HTML tags, and print their content or attributes.
- Python 3.x
- beautifulsoup4
- requests
Contributions are welcome! If you have any suggestions or improvements, please feel free to submit a pull request.
This project is licensed under the MIT License.