ulixee / secret-agent

The web scraper that's nearly impossible to block - now called @ulixee/hero
https://secretagent.dev
MIT License
670 stars 44 forks source link

manually set user agent #227

Closed Nisthar closed 3 years ago

Nisthar commented 3 years ago

Is there currently an option to manually set the user agent ?

calebjclark commented 3 years ago

Not directly, although you can pass in browserEmulatorId, which controls the general range of the user-agent (https://secretagent.dev/docs/advanced/browser-emulators#preloaded-plugins).

Do browser emulators give you what you need or are you looking for something more?

calebjclark commented 3 years ago

This feature has been added to the new 1.5 release which we are in the middle of pushing to NPM.

userAgent is now an option when creating a new Agent:

const agent = new Agent({ userAgent: 'Whatever User Agent String You Want' {);