Web scraping extracts unstructured or semi-structured information from websites and transforms it into structured data for analysis. It extends analytical workflows when useful information is not available through a ready-made API. section 10.2 section 10.0
The process resembles an API request, but the response is HTML rather than formatted JSON. The scraper must identify relevant tags, interpret the nested document structure, and extract the required values. section 10.2.1 section 10.4
A practical scraping workflow typically involves:
- Requesting a target page with Python's requests library and checking the response. section 10.2.1
- Reading the response text instead of treating the HTML page as JSON. section 10.2.1
- Parsing and inspecting the HTML with BeautifulSoup, then locating tags such as paragraphs, links, and sections. section 10.2.1
- Extracting, standardizing, and compiling selected fields into a data structure suitable for analysis. section 10.2 section 10.2.4
Weather forecast extraction
A forecast page can be requested when an API is unavailable. The returned HTML is inspected with BeautifulSoup so forecast parameters can be extracted and standardized for analysis. section 10.2.1
Figure 10.7 Unstructured data doesn’t have a predefined format and may require extensive processing.
Use the figure to distinguish unstructured web content from data already organized in a predefined format. section 10.2
Scraping can monitor competitor prices, social-media trends, financial information, and other changing sources. It is repeatable and can combine information from multiple websites, but changing page layouts make pipelines brittle. section 10.2 section 10.2.3
Responsible use requires checking site rules, robots.txt, permitted pages, and rate limits. Ignoring restrictions can lead to blocked access, while dynamic content may require maintenance when websites change. section 10.2.4 section 10.4








