Crawl: the most reliable web crawler APISee what’s new
Zenrows
Talk to sales Start free

Web scraping for research

Web scraping for research collects a study's data from public websites: article metadata, forum posts, news coverage, government statistics or Wikipedia revisions. Zenrows fetches those pages, JavaScript-heavy and protected ones included, and returns HTML, Markdown or JSON, so your methods section records exactly what was collected, from where and when.

Updated

Sample output: one record in a study corpus
{
  "study_id": "housing-discourse-2026",
  "record_id": "r-000184",
  "source_type": "public forum",
  "url": "https://forum.example.org/t/rent-increase-notice/48213",
  "collected_at": "2026-10-17T09:41:27Z",
  "request": { "mode": "auto", "response_type": "markdown" },
  "http_status": 200,
  "content_sha256": "3b1f0c9a...",
  "title": "Rent increase notice after lease renewal",
  "published": "2026-09-30",
  "author_id": "u_7f3a (pseudonymized)",
  "word_count": 412,
  "replies": 23,
  "language": "en",
  "inclusion": { "matched_terms": ["rent increase", "lease"], "excluded": false }
}
Illustrative, with the URL, fetch time, parameters and hash a reviewer needs.

What researchers collect from the web

Researchers scrape when the data a question needs is not yet a clean dataset.

The most common sources:

JobData you collectTypical sources
Literature and citation mapping Title, authors, venue, year, DOI, abstract, citations Google Scholar, arXiv, PubMed, Crossref, Springer, Wiley, MDPI
Social science corpora Posts, comments, timestamps, threads, votes Reddit, Stack Exchange, public forums, YouTube comments
Media framing studies Headline, text, section, date, byline News sites and archives
Policy and legislative analysis Bills, consultation responses, committee reports, agency statistics parliament.uk, europa.eu, state legislatures, national statistics offices
Economics and price research Prices, attributes, availability on a fixed schedule Retailer and marketplace pages
Knowledge production studies Revisions, edit histories, talk pages, contributor counts Wikipedia, Fandom, public wikis

Why research data collection goes wrong

A prototype scraper rarely survives peer review; the worst failures leave silent gaps or cannot be explained.

What it looks like

A reviewer asks how the corpus was built; the script no longer runs

How Zenrows handles it

Each request is a URL plus explicit parameters, so the log documents every fetch

How to use web scraping for research

  1. Write the collection protocol first: sources, inclusion rules, dates, fields, pace; ethics approval if people are involved.
  2. Use official APIs and dumps where they exist (Wikipedia, arXiv, Crossref); scrape the rest.
  3. Build the sample frame with Crawl: every in-scope URL before any content, saved with the dataset.
  4. Fetch with fixed parameters and log everything: URL, time, parameters, status and hash per record, paced per domain.
  5. Archive raw responses to re-code later without recollecting.
# Fetch a sample frame politely and log provenance for every record
# pip install requests
import csv, hashlib, time, requests
from datetime import datetime, timezone

PARAMS = {"mode": "auto", "response_type": "markdown"}
urls = [line.strip() for line in open("sample_frame.txt") if line.strip()]

with open("collection_log.csv", "a", newline="") as log:
    writer = csv.writer(log)
    for i, url in enumerate(urls):
        r = requests.get("https://api.zenrows.com/v1/",
                         params={"apikey": "YOUR_ZENROWS_API_KEY", "url": url, **PARAMS})
        digest = hashlib.sha256(r.content).hexdigest()
        with open(f"raw/{i:06d}.md", "wb") as f:
            f.write(r.content)
        writer.writerow([i, url, datetime.now(timezone.utc).isoformat(),
                         r.status_code, digest, PARAMS])
        time.sleep(2)  # pace requests per your protocol

What success looks like

MeasureWhat good looks likeHow to check it
Sample completeness Each frame URL has a response or a logged, explained failure Log against frame before analysis
Reproducibility Others can rerun from your URL list and parameters Publish list, code and parameters; test a subset rerun
Provenance URL, fetch time, parameters and hash on every record Check the final schema for missing fields
Data minimization Only the fields protocol and ethics approval allow Audit fields against protocol before sharing
Load on sources Requests per domain within your protocol's pace Requests per domain per minute in the log

Web scraping for research FAQ

  • Many universities and funders accept web data, and several jurisdictions have research text and data mining exceptions: Article 3 of the EU copyright directive, section 29A of the UK copyright act. Site terms and privacy law still apply; ask your research office or counsel first.

  • Data about people (posts, comments, profiles) is usually human subjects research, reviewed by an ethics board or IRB. Pseudonymize usernames, keep only needed fields, store securely, and avoid identifying verbatim quotes.

  • Save the frame, code, parameters and a per-record log (URL, time, status, hash), and archive raw responses. Pages change, so reruns will not match byte for byte, but others can see what you collected and repeat the method.

  • Slowly enough that the site would not notice. Set a per-domain pace (say, one request every few seconds for small sites), read robots.txt, and spread large runs over days. Zenrows handles access; pace is your ethics call.

  • Yes. Google Scholar has no public API and serves CAPTCHAs after a few automated queries. Fetch results through Zenrows' stealth for title, authors, venue, year and citations, then enrich each record from Crossref or the publisher's page by DOI.

  • Crawl the section for thread URLs in your date range, fetch each as Markdown or named fields (text, handle, timestamp, reply depth), and pseudonymize handles. Pilot a few hundred threads, check pagination in long ones, and fix the protocol before the full run.

  • Share the URL list, code and log openly. Raw content may be copyrighted or personal, so many projects publish identifiers and derived variables and share full text under a data use agreement.

  • Yes, when the data is on web pages, not in a file. Use Markdown for text models or CSS-selected fields for tables, load into pandas, and keep the provenance log.

Turn the live web into usable data.