Amazing-Python-Scripts
Web Scraping with Beautiful Soup
This script performs web scraping on a CodeChef problem statement webpage using the Beautiful Soup library in Python.
Description
The Python script utilizes the requests
and BeautifulSoup
libraries to extract information from a CodeChef problem statement webpage. It demonstrates the following actions:
- Printing the title of the webpage.
- Finding and printing all links on the page.
- Extracting text from paragraphs.
- Extracting image URLs.
- Counting and categorizing HTML tags.
- Filtering and printing valid links.
- Saving extracted data to a text file.
Prerequisites
Ensure you have the following libraries installed:
requests
beautifulsoup4
You can install them using the following commands:
pip install requests beautifulsoup4