Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
  1. Home
  2. Blog
  3. Our Selenium Scraper Takes Hours and Keeps Crashing. Should We Rewrite It in Scrapy?
Problems We Solve

Our Selenium Scraper Takes Hours and Keeps Crashing. Should We Rewrite It in Scrapy?

A Selenium scraper too slow to finish usually runs a browser it does not need. SpiderHunts rebuilds collection with Scrapy or plain HTTP where the site allows.

Updated 3 min readBy SpiderHunts Technologies

Free estimateNo obligation

Get a free estimate

Tell us what you need. A senior engineer reads every enquiry.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →

Quick answer — TL;DR

Selenium scrapers are slow because they load full pages, images and scripts in a real browser, one page at a time. For most sites Scrapy or plain HTTP requests do the same job far more efficiently, with Playwright kept for the few pages that truly need a browser. SpiderHunts measures where time goes and rebuilds the collection accordingly.

An overnight job that is still running at lunch

The scraper started small and worked. Then the list of pages grew. Now it runs overnight, is still going when people arrive, and sometimes crashes halfway with a browser error, leaving a half-finished spreadsheet. Someone restarts it from the beginning.

Running it on a bigger machine helped briefly. Running several copies at once made the target site start refusing connections.

Where the time actually goes

Selenium drives a real browser. For each page it loads the HTML, the stylesheets, the scripts, the fonts, the images and the tracking tags, runs all the JavaScript, and only then lets your code read the page. Most of that has nothing to do with the data you want.

Selenium scripts also tend to wait with fixed sleeps, process pages strictly one after another, and restart the browser when anything goes wrong.

SymptomCommon cause
Very slow per pageLoading every asset in a full browser
Slow overallOne page at a time, fixed sleeps
Crashes midwayBrowser memory growth, unhandled pop-ups
Restarts from scratchNo record of which pages are done
Site starts blockingParallel browsers generating bursts of traffic

Scrapy works differently. It requests pages over HTTP without rendering them, handles many requests concurrently within limits you set, retries failures and keeps track of what is done. When the data is in the HTML or an API response, that is a far better fit.

What a slow scraper costs

Data arrives late or incomplete, so reports built on it are unreliable. Hosting costs rise because browsers need a lot of memory. Staff time goes on babysitting and restarting. And the bursts of browser traffic make the site more likely to block you, which is the one outcome that stops everything.

The restarts deserve their own mention. A job that has to begin again from the first page after every crash repeats hours of work and sends the same requests to the site twice, which is wasteful for you and unwelcome for them.

How we speed up collection

  1. We confirm the site's terms and robots.txt permit what you are doing, and check for an API or feed first.
  2. We profile the current job: how many pages, how long each takes, and where the data actually comes from.
  3. Pages whose data is in the HTML or in a JSON response are moved to Scrapy or plain asynchronous HTTP requests.
  4. Pages that truly need JavaScript stay in a browser, usually Playwright, with images and unneeded assets blocked, smart waits instead of fixed sleeps, and one browser reused across many pages.
  5. We add polite concurrency limits and delays so the job is faster for you without hammering the site.
  6. Progress is saved as pages complete, so a failure resumes where it stopped rather than starting again.
  7. Results are validated and loaded into a database, with a run report and alerts if counts drop or errors rise.

Faster does not mean more aggressive. Most of the gain comes from not doing unnecessary work, not from hitting the site harder.

A job that finishes before anyone notices

The collection runs in a sensible window, finishes, and reports what it collected. When it fails, it picks up from where it stopped. It uses a modest server instead of a large one. And it is gentler on the target site, which makes blocking less likely.

The code is also easier to maintain, because site-specific parsing is separated from the crawling machinery.

Hosting becomes simpler too. A crawling job that no longer needs dozens of browser instances can run on a small server or a scheduled cloud function, and the saved progress means an interrupted run costs you minutes of repeat work rather than the whole night.

Recognise this?

  • Your scraping job runs for hours
  • It crashes and restarts from the beginning
  • It uses Selenium for every page
  • Adding parallel copies led to blocks
  • Hosting it needs a large server

FAQ

Frequently asked questions

The questions readers ask us after this guide.

Still have a question?

Ask us directly — a senior engineer will get back to you.

Ask about your project

Is Scrapy always better than Selenium?

No. Scrapy is better when the data is available without running JavaScript, which is common. For pages that need a browser, a browser tool is still the right choice.

Can we keep parts of our existing code?

Often the parsing logic can be reused. The crawling and browser handling is what usually changes.

Will a faster scraper get us blocked?

Not if it is designed properly. We set polite limits, and most speed comes from avoiding unnecessary page loads rather than more traffic.

What affects the cost?

The number of sites and page types, how many need a browser, and how the results need to be stored and checked.

Keep reading

More on Problems We Solve

Start here

Scraping jobs taking forever?

Describe the sites, what you need from them and what has gone wrong so far. We will say which route we think is right, including when the honest answer is an official feed, a data licence or not collecting it at all.

  1. You tell us what you needTwo minutes on the form, or a message on WhatsApp.
  2. A senior engineer reviews itAnd comes back with questions, a realistic range and an honest view on fit.
  3. Free 30-minute scoping callWe talk through scope, options and a realistic estimate — with no obligation.
Free estimateNo obligation

Talk to someone who builds this

Send a short brief and we will come back with an honest view and a realistic range.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →