Hacker News new | past | comments | ask | show | jobs | submit login

Is there a difference between Chrome+puppeteer vs Chrome+selenium?

Is there anything special that Chrome headless has that ordinary Chrome wouldn't have?




Chrome headless is just that. Chrome that’s headless. Selenium is a cross browser api that connects to browser via some port. But usually it’s a high level api since it’s a common denominator of browser apis. Selenium uses middleware webdriver libs sometimes and usually quite bloated.

Puppeteer uses Chrome Remote Debug Protocol, which is the same protocol Devtools uses. It’s just a simple JSON RPC over websockets. Puppeteer creates a nice library abstraction over this api.

The advantage of puppeteer over selenium is that you have a lot more control over chrome. Network, perf, screenshots, coverage, dom & style traversal, etc. It’s a very reliable API too since Chrome Devtools team maintains the backend.

Selenium on the other hand surprises me with all sorts of quirks.


Been using selenium and webdriver with ruby for the past five years, there is pretty much nothing it cannot do. Performance is a big hit, though.


I really love Selenium actually.. makes me feel.. powrful, somehow, like an evil genius or something


My evil genius moment with selenium happened when I ran a headless client to visit the login page of a bank, wait for 2fa sms code from my Android application, then use the code to log in and place some automated stock orders.


I know plenty of people who dislike working with Selenium. I haven't yet met anyone who's had enough experience with Puppeteer to hate it yet.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: