Hello sir, could you help me please? I would like to load random useragent for each page lunch. How do i do that? Example: page.setUserAgent('/utils/referers.txt');
thank you
I would have a variable called userAgents that is an array of user agent strings then do something like
await page.setUserAgent(userAgents[Math.floor(Math.random()*userAgents.length)]);
I logged in just to add like to this comment
thank you :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello sir,
could you help me please?
I would like to load random useragent for each page lunch.
How do i do that?
Example:
page.setUserAgent('/utils/referers.txt');
thank you
I would have a variable called userAgents that is an array of user agent strings then do something like
await page.setUserAgent(userAgents[Math.floor(Math.random()*userAgents.length)]);
I logged in just to add like to this comment
thank you :)