How to Solve Captcha with Python?

Irfan Ahmad
Geek Culture
Published in
2 min readDec 26, 2021

Scraping A Dynamic Website, Part-V: Handling Captcha

Captcha are a big hurdle when we try to scrap some really secure website.

image showing I’m not a robot
I’m not a robot

It is said that captcha can be avoided by implementing ‘webdriver waits’ and by reducing pooling frequency. But in my case, it never worked.

How Did I Solve Captcha Then!

Here are some options that I could implement to tackle captcha;
1- put waits and set less polling frequency (never worked for me)
2- use machine learning models (a costly and resource taking method)
3- use speech-to-text or text-to-speech options (easy one, but not always available)
4- use some captcha solving service (I found it to be a best option. It’s cost + resource effective.)

So, I selected option 4. Here is how it works.

Solving Captcha

Just follow the steps.

1- Create an account at https://anti-captcha.com/ and get your ACCESS TOKEN.
2- Download the ‘anticaptcha’ plugin for your browser i.e, chrome, firefox etc. from here. Keep this plugin in your working directory to prevent access problems.
3- Add this in your script

Put this before you start scraping in your script.

That’s all. It worked for me. And, I hope it will work for you too.

Let me be clear, it was not sponsored writing for ‘anti-captcha.com’. I wrote this because I found it useful.

Regards

--

--

Irfan Ahmad
Geek Culture

A freelance python programmer, web developer and web scraper, data science and Bioinformatics student.