Giter Site home page Giter Site logo

Comments (5)

zfcsoftware avatar zfcsoftware commented on September 25, 2024 1

Thank you very much. I will definitely perform tests on the relevant site and update it.

from puppeteer-real-browser.

zfcsoftware avatar zfcsoftware commented on September 25, 2024 1

The library has been updated, please check again.

from puppeteer-real-browser.

alshahabrezvi avatar alshahabrezvi commented on September 25, 2024 1

this update was amazing. but timezone was not updating using my ip address. i have writen a code to update my timezone using my ip. i thing you should add that in your nezt update as far you have done a nice work.
before:
image
after:
image

my next automation package..

from puppeteer-real-browser.

zfcsoftware avatar zfcsoftware commented on September 25, 2024 1

this update was amazing. but timezone was not updating using my ip address. i have writen a code to update my timezone using my ip. i thing you should add that in your nezt update as far you have done a nice work. before: image after: image

my next automation package..

Hello, this is a general problem caused by puppeteer. The reason it is detected is that the ip and browser timezone values do not match. Until then, you can check the values below and add the codes. Sites can read your browser language and timezone value in many values such as browser.languages and Intl.DateTimeFormat().resolvedOptions() in the header sent when requesting. You need to change this according to your ip address.

image

check: https://webbrowsertools.com/timezone/
Intl.DateTimeFormat().resolvedOptions()

add args: ['--lang=en-GB', '--timezone=Europe/London']

add code:

 await Page.emulateTimezone('Europe/London');
 await Page.setExtraHTTPHeaders({
     'Accept-Language': 'en-GB,en;q=0.9,en-US;q=0.8,en;q=0.7'
 });
 await page.evaluateOnNewDocument(() => {
        Intl.DateTimeFormat.prototype.resolvedOptions = function () {
            return {
                locale: 'en-GB',
                "calendar": "london",
                "numberingSystem": "latn",
                "timeZone": "Europe/London",
                "year": "numeric",
                "month": "2-digit",
                "day": "2-digit"
            };
        };
    });
  await page.evaluateOnNewDocument(() => {
        Object.defineProperty(navigator, "language", {
            get: function () {
                return "en-GB";
            }
        });
        Object.defineProperty(navigator, "languages", {
            get: function () {
                return ["en-GB", "en"];
            }
        });
    });

from puppeteer-real-browser.

alshahabrezvi avatar alshahabrezvi commented on September 25, 2024

I am using proxy. And each proxy has different country location. Can you help me how can i set different timezone in each browser?

from puppeteer-real-browser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.