Hey guys, just wanted to share my new Nim library cdp. It's a low-level wrapper for Chrome DevTools Protocol (CDP).
All you need is to have Chrome installed on your system and it will work like magic. Will be adding Chromium and Edge support later.
If you didn't know, CDP is used by Chrome DevTools itself and maintained by that team.
CDP gives you complete control over your browser. Even more than what you can accomplish with a webdriver. You can scrape dynamic webpages, create browser automations, and beyond!
I tried to be as thorough as possible in the README to give some basic understanding of CDP along with the API and some examples, as it's totally worth learning CDP if you're into web scraping or any kind of browser automation.
This isn't nearly as high-level as Puppeteer but it's a start ;)
I was thinking about this recently, and tried implement it myself last night, then I found your repo, that's lucky,.
I have exists project use https://github.com/halonium/halonium, am planning use cdp instead.
From what I can tell, the cdp lack of dom domain, tab domain apis, and page domain lack of Page.addScriptToEvaluateOnNewDocument wrapper, and the disadvantage compare to chrome driver wrappers is it lack some features that chrome driver options supported. like load packed extension (.crx).
@bung Yeah the webdriver libraries may have some features that CDP doesn't but it's because CDP is just the protocol. You can make your own functions on top of it, like loading a packed extension (I assume). PRs welcome if you do create higher level APIs for things like that, I would like to have this library more friendly for Nim devs.
I do want to mention though- CDP gives direct and granular control over your browser, webdrivers don't. Off the top of my head I believe network interception and manipulation, and some performance audits aren't able to be done with webdrivers.