You could try using proxies or a headless browser like Puppeteer, but if you want to really fullproof your script against CAPTCHAs, might be worth going with a scraping tool with fingerprint emulation and block bypassing technology. I've been using this one because it can be easily integrated into existing Puppeteer/Selenium/Playwright scripts and comes with in-built unblocker technology that automatically handles things like browser fingerprint emulation/header information/cookie management (which solves a major chunk of the problem, keeping websites from flagging you as a potential bot and generating the CAPTCHA in the first place), and can also solve most CAPTCHAs like reCAPTCHA, hCaptcha, px_captcha, SimpleCaptcha, etc. Pretty much eliminates the need to rely on third-party libraries or additional proxies into your code.