最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Puppeteer with Brave browser? - Stack Overflow

programmeradmin0浏览0评论

I'm wondering if it's possible executing a puppeteer script using Brave browser instead of the basic version of chromium. I know that Brave has been developed from chromium, and for that reason you can launch a selenium script using brave, but do you know if it's possible with puppeteer as well?

I'm wondering if it's possible executing a puppeteer script using Brave browser instead of the basic version of chromium. I know that Brave has been developed from chromium, and for that reason you can launch a selenium script using brave, but do you know if it's possible with puppeteer as well?

Share Improve this question edited Dec 26, 2019 at 2:50 Drun asked Dec 26, 2019 at 0:50 DrunDrun 6191 gold badge9 silver badges18 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 19

Yes, you can use Brave. The only catch is the adblocking doesn't work with headless mode. For the adblocking in headful mode, you need to set/create a profile and point the userDataDir option to it because Brave downloads the filter lists the first time it launches and stores those lists in the profile.

const browser = await puppeteer.launch({
        headless: false,
        executablePath: "path/to/brave",
        userDataDir: "path/to/profile/dir"
});
发布评论

评论列表(0)

  1. 暂无评论