Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time Zone Based on IP ,Time Zone,Time From IP,Time From Javascript #2790

Closed
xipeng5 opened this issue May 20, 2024 · 6 comments
Closed
Labels
duplicate The answer/solution already exists somewhere external Outside SeleniumBase's scope. / Ask somewhere else. UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode

Comments

@xipeng5
Copy link

xipeng5 commented May 20, 2024

IP based time zone, local time zone, IP based time, local time, WebGL, WebGL Report, WebGPU Report,

some issues were found. Unable to set these parameters on your own. Some parameters, such as WebGL, WebGL Report, and WebGPU Report, are fixed and cannot be randomly generated every time the target website is visited

image
image

And in UC mode, the xpath uc selector cannot be used
image

@mdmintz mdmintz added duplicate The answer/solution already exists somewhere external Outside SeleniumBase's scope. / Ask somewhere else. UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode labels May 20, 2024
@mdmintz
Copy link
Member

mdmintz commented May 20, 2024

All fingerprint masking is done via the external selenium-stealth integration: #2404 (comment)

However, there are ways to change properties via execute_cdp_cmd: (As mentioned in #918 (comment))

tz_params = {'timezoneId': 'America/New_York'}
driver.execute_cdp_cmd('Emulation.setTimezoneOverride', tz_params)

(Note that you'll likely need to load the page first, then call the driver.execute_cdp_cmd command, and then refresh the page for the settings to take effect. Calling the uc_open methods will reset settings made be driver.execute_cdp_cmd.)

And as mentioned in #2658 (comment), uc_click() requires JS, which needs selectors to be in CSS Selector format. Use a CSS Selector instead, or a valid XPath that has a CSS Selector equivalent. Not all XPaths can be directly translated into matching CSS Selectors, but all elements can be expressed via CSS Selector, so just give it a CSS Selector directly instead.

@mdmintz mdmintz closed this as completed May 20, 2024
@xipeng5
Copy link
Author

xipeng5 commented May 21, 2024

Thank you very much for your reply. Your library has benefited me greatly. Sincerely thank you, but I have encountered some issues. I tried to register an account using your library, but every time it failed. I used a proxy IP and set the browser's fingerprint and other parameters, but none of them worked. I don't know where the problem is. If it doesn't take up your time, I hope you can help me take a look at the code. Below is the code snippet link. Thank you very much and I wish you a happy life。https://github.com/xipeng5/testap/blob/main/test.py

@mdmintz
Copy link
Member

mdmintz commented May 21, 2024

SeleniumBase UC Mode doesn't do fingerprint alteration. It makes your browser appear as though a human is controlling it, rather than Selenium. The browser fingerprint will be the same as if a human navigated to a website from that network. For fingerprint alterations, you'll need to use external libraries, such as https://github.com/diprajpatra/selenium-stealth. You might also find answers on https://stackoverflow.com/.

@xipeng5
Copy link
Author

xipeng5 commented May 21, 2024

Thank you very much for your reply. My English level is not very good. I will use a translator to complete the conversation with you. If there is anything offensive in my language, please understand. Regarding your suggestion of using selenium Stealth to create fingerprints, I will try it later. I would like to ask you a question as you have done so many automated scripts. What do you think is the core issue with my account registration? Do you think setting up a fingerprint proxy will solve the difficulties I am currently facing? Thank you for your reply. Looking forward to communicating with you

@mdmintz
Copy link
Member

mdmintz commented May 21, 2024

Using a proxy can help. proxy=username:password:host:port or proxy=host:port to set one with SeleniumBase. I don't know about fingerprint modification, so I can't help there. That's why I recommended using an external library for that, such as https://github.com/diprajpatra/selenium-stealth. SeleniumBase UC Mode makes your Selenium browser appear the same as a regular web browser. If you run into issues on a website when using a regular browser, then it could be that your IP Address was blocked.

@xipeng5
Copy link
Author

xipeng5 commented May 21, 2024

Thank you very much for your reply. I will try what you said and then come back to ask for your advice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate The answer/solution already exists somewhere external Outside SeleniumBase's scope. / Ask somewhere else. UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode
Projects
None yet
Development

No branches or pull requests

2 participants