AI Newsway
Back to glossary

Web Scraping

Data

Web scraping is the automated extraction of data from web pages, usually by fetching HTML and parsing the elements that hold the values you want. It is the fallback when a site offers no API. A simple scraper sends an HTTP request and reads the markup with a parser such as Cheerio or BeautifulSoup, while a page that builds its content in JavaScript needs a headless browser like Playwright or Puppeteer to render first. Scrapers break often, because a redesign that changes one class name silently empties a selector, so production pipelines add retries, change detection, and alerting. Common uses include price monitoring, news aggregation, lead research, and collecting training corpora for AI models, which has made the practice contentious: publishers have sued over unlicensed use of their archives, and many sites now block known AI crawlers in robots.txt. The legal picture varies by jurisdiction and depends on the site's terms, whether the data is personal, and how the copy is used. Responsible scraping means honouring robots.txt, rate limiting, identifying your client, and preferring an official API or feed whenever one exists.