Hey! I've been using headless chrome with Puppeteer for a while now, and the biggest gotcha for me was missing waits for dynamic content.
You gotta use `page.waitForSelector()` or `page.waitForFunction()` religiously. Otherwise, stuff just... doesn't load. Also, set a realistic `user-agent` and throttle your CPU to mimic human behavior.
For avoiding blocks, I rotate proxies (BrightData works well) and randomize click delays. It's a pain, but it works.
Here's a quick config snippet I use:
```javascript
const browser = await puppeteer.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
});
```
You gotta use `page.waitForSelector()` or `page.waitForFunction()` religiously. Otherwise, stuff just... doesn't load. Also, set a realistic `user-agent` and throttle your CPU to mimic human behavior.
For avoiding blocks, I rotate proxies (BrightData works well) and randomize click delays. It's a pain, but it works.
Here's a quick config snippet I use:
```javascript
const browser = await puppeteer.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox']
});
```
