Open-source intelligence (OSINT) is the art of learning about a target from public information — and a huge amount of it lives on web pages. This lesson shows how Python turns a human-readable page into structured data you can act on.
Why scraping is a recon skill
A company's own website leaks useful detail: employee names, email formats, technologies, document links. Reading one page by hand is fine; reading a hundred isn't. Scraping automates the reading.
Fetch the page
import requests
r = requests.get('https://example.com')
html = r.text
print(len(html), 'characters downloaded')
Pull out the useful bits
BeautifulSoup parses messy HTML into something you can query.
from bs4 import BeautifulSoup
soup = BeautifulSoup(html, 'html.parser')
# every link on the page
for link in soup.find_all('a'):
print(link.get('href'))
Harvesting all the links can reveal hidden pages, PDFs and login portals.
Finding emails with regex
import re
emails = re.findall(r'[\\w.+-]+@[\\w-]+\\.[\\w.-]+', html)
print(set(emails)) # unique ones
Spot the email pattern — first.last@company.com — and you can often guess every employee's address.
| Tool | Turns... | ...into |
|---|---|---|
requests | A URL | Raw HTML text |
BeautifulSoup | Raw HTML | Links, headings, tables |
re (regex) | Text | Emails, phone numbers, keys |
Tip: Respect
robots.txtand a site's terms, add delays between requests, and never scrape login-protected or personal data you aren't authorised to collect. OSINT uses public information — the moment you bypass an access control, it stops being OSINT and becomes intrusion.
From data to insight
Scraping is only step one. The skill is turning a pile of links and emails into a picture of the target — its people, its tech, its weak spots — which is exactly what a real engagement's recon phase produces.