Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The GP is describing lots of timing-related issues. It's possible you experience much lower latency than the GP.

I've never used Puppeteer, but having used a lot of US-hosted web services from Asia, I've seen plenty of latency-sensitive bugs (or at least annoyances not present for NYC-based users).



There are all sorts of annoyances that can manifest differently in different parts of the world when doing various forms of browser automation from different parts of the world.

Different cdn behaviors and differences in the way bot detection logic gets triggered due to geoip ip categorization lists (which definitely impact a lot of sites, often in subtle ways when - say - only a subset of the javascript assets on a page fail to load).

In my experience though, these observations are just as likely to be programmer error as they are to be legitimate claims that 'my code doesn't work because of timing issues in the puppeteer implementation.' The programming model that puppeteer exposes tends toward the rational in my opinion.

Browser automation often involves asynchronously instructing the page to simulate a click on something in order to induce some javascript in a page to run some effect, in order to repaint the dom -- and this kind of logic chain will _always_ demonstrate timing variation. But the puppeteer api's make it pretty straightforward to sequence the events that are simulated so that you can ensure you issue a click on something that exists or a waitForSomethingToExist polling based detector that will trigger reliably when a given dom node appears ... Depending on the specific page's implementation, sometimes this kind of logic can be harder to write for one page than another -- but my first guess for the reason why a given page might make this kind of logic flakey or hard to implement is more likely to be an obscure implementation detail of the page than a puppeteer bug (as a first approximation).


It's the async parts that are buggy and have race conditions. Sometimes the wait works, sometimes it doesn't (and I can clearly see the element being rendered in the browser and available in the DOM). It's quite the opposite, in fact: sometimes, Puppeteer forces me to use synchronous solutions (i.e. ugly delays) to avoid using the wait functions "too much".




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

Search: