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

3.0.3 #255

Merged
merged 1 commit into from
Jul 29, 2021
Merged

3.0.3 #255

merged 1 commit into from
Jul 29, 2021

Conversation

ultrafunkamsterdam
Copy link
Owner

v 3.0.3 finally [ why 303 is such a good number ]

Hello lovebirds,

  • fixed a bug where driver hangs long time on quit
  • passing executable_path explicitly to Chrome() now causes chromedriver to not redownload, since some people have issues downloading 3mb but expect to build next-gen scrapers

some free tips regarding some commonly raised issues:

1 - "Wrong version is downloaded, lets download the new chrome and hardcode it in v2.py"

solution:

driver = uc.Chrome(version_main=92)    # or 90, 91, 93

if the file is locked somehow and does not overwrite it:

driver = uc.Chrome(version_main=92, patcher_force_close=True)

2 - "look at all those option flags and arguments i copied from some blog, but your chromedriver doesnt work dude"
example:

options = uc.ChromeOptions() 
options.headlesss = True      
options.add_argument('--headless')   # << WRONG. since now chrome starts up using --headless --headless

try to keep it as simple as possible. most of required options are built in
better yet:  

driver = uc.Chrome(headless=True)    # done

3 - "Some cloudflare site xyz gives me endless loop help help"

 believe me: we know.. really. no need to raise 36 issues regarding some dodgy site using cloudflare.
 
 i know how they do it. that's one step forward.

4 - "help me i'm trying your driver but does not run on commodore64 or alike - please assist"

No

5 - "does this work in C#, C++, --c, Haskell, Java, Assembly, dos prompt?"

Probably, if you know how to rewrite it. But i'm not going to do it.

6 - "I have a question on basic webdriver stuff which are not are not a part of your library but you still need answer me! NOW!"

NO! 
look here : https://selenium-python.readthedocs.io/
or here: https://google.com

…ssing executable_path explicitly now causes chromedriver to not redownload since some people have issues downloading 3mb but expect to build next-gen scrapers
@ultrafunkamsterdam ultrafunkamsterdam merged commit 9ad1bb3 into master Jul 29, 2021
@ultrafunkamsterdam ultrafunkamsterdam added the documentation Improvements or additions to documentation label Jul 29, 2021
@HMaker
Copy link

HMaker commented Aug 9, 2021

@ultrafunkamsterdam Funny joke on commit message haha but avoiding re-download and re-patch for every run is suitable for many cases, for example on containerized webdrivers. Currently I run chromedriver based on alpine linux image in docker containers:

FROM python:3.8.7-alpine3.12

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN apk add chromium chromium-chromedriver
ENV CHROMEDRIVER_PATH /usr/lib/chromium/chromedriver
RUN python -c "from undetected_chromedriver.patcher import Patcher; patcher = Patcher(version_main=86); patcher.executable_path = '$CHROMEDRIVER_PATH'; assert patcher.patch()"
RUN ln -s /usr/bin/chromium-browser /usr/bin/google-chrome

@ultrafunkamsterdam
Copy link
Owner Author

@ultrafunkamsterdam Funny joke on commit message haha but avoiding re-download and re-patch for every run is suitable for many cases, for example on containerized webdrivers. Currently I run chromedriver based on alpine linux image in docker containers:

FROM python:3.8.7-alpine3.12

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN apk add chromium chromium-chromedriver
ENV CHROMEDRIVER_PATH /usr/lib/chromium/chromedriver
RUN python -c "from undetected_chromedriver.patcher import Patcher; patcher = Patcher(version_main=86); patcher.executable_path = '$CHROMEDRIVER_PATH'; assert patcher.patch()"
RUN ln -s /usr/bin/chromium-browser /usr/bin/google-chrome

Hi @HMaker ,

Thank you for your comment.

passing executable_path explicitly to Chrome() now causes chromedriver to not redownload

please try.

Kind regards,
leon

@bezkos
Copy link

bezkos commented Sep 26, 2021

I dont know if its bug but when u try to add some additional arguments with add_argument function, u ll see double --headless entry even if u use options.headlesss = True instead of options.add_argument('--headless').

@ngokhang66
Copy link

quit() function is not working to close chrome driver

@bezkos
Copy link

bezkos commented Oct 19, 2021

@ngolun669, U dont need to do it, UC do it by itself.

@sunny9495-dev
Copy link

how to disable chrome password manager, i tried
prefs = {"credentials_enable_service": False,
"profile.password_manager_enabled": False}
options.add_experimental_option("prefs", prefs)

but it isnt worked.

@CoderVietAnhLe
Copy link

i cant using multi thread? driver open and can not close , when i using options.user_data_dir = "c:\temp\profile"
self.service.process.kill()
AttributeError: 'Chrome' object has no attribute 'service'
how can i fix it? can you give me some example? thank you
And is there any way to install addon in uc? i try but not work, i need it :( , thank youuuuuu

@sokolov172
Copy link

@ultrafunkamsterdam Hello. I could help you to test data_dome service. if its interesting to you - write me

@cesarfarhat
Copy link

@ultrafunkamsterdam Hello. I cant start UC on a virtual display, the driver never starts. If I try with selenium or selenium wire it starts.

@CoderVietAnhLe
Copy link

CoderVietAnhLe commented Dec 22, 2021

Big error, undetected-chromedriver 3.1 not work when im build to exe. try in Cx_freeze and Py auto exe

@shahrooz1397
Copy link

please someone tell me how to disable redownloading driver by each run
i tried both
executable_path=path and browser_executable_path=path
but it still redownloads how to avoid that?

@shahrooz1397
Copy link

your driver cant open new tab
driver.execute_script('''window.open('');''')
by executing this nothing happens

@tmb5cg
Copy link

tmb5cg commented Apr 28, 2022

This is so funny props to you

@psyhceros
Copy link

I have this error This version of ChromeDriver only supports Chrome version 104 Current browser version is 103.0.5060.134 undetected chrome driver. I just update Chrome to the latest version and it works.

@krypterro
Copy link

"passing executable_path explicitly to Chrome() now causes chromedriver to not redownload, since some people have issues downloading 3mb but expect to build next-gen scrapers"

We have 16 servers running hundreds of concurrent sessions at a time, and running fresh every 5 minutes, so that 3MB is multiplied by the thousands per hour. We don't particularly care about bandwidth usage, but it would be nice if there was a happy medium between downloading the file every time, and being to set a time limit. For example, it only downloads the file if the file is over 5 minutes old.

@tmb5cg
Copy link

tmb5cg commented Aug 17, 2022

"passing executable_path explicitly to Chrome() now causes chromedriver to not redownload, since some people have issues downloading 3mb but expect to build next-gen scrapers"

We have 16 servers running hundreds of concurrent sessions at a time, and running fresh every 5 minutes, so that 3MB is multiplied by the thousands per hour. We don't particularly care about bandwidth usage, but it would be nice if there was a happy medium between downloading the file every time, and being to set a time limit. For example, it only downloads the file if the file is over 5 minutes old.

Bruv it's open source and free, your frustration is laughable

@krypterro
Copy link

If you had a donation button somewhere we'd resolve the free part. Just pointing out that some of us are using your code for large scale commercial applications. But of course you are correct on the open source part, I'll be glad to code that up when I get time. Which I rarely do...which is why I mentioned it. Nevertheless, the project is awesome, and we certainly appreciate the hard work that goes into it.

@ECHO-ECHOOooo
Copy link

I am trying to access a web3 site that requires the metamask extension for logging in to the site. The standard selenium chromedriver supports an options.add_extension method that can be passed to the driver when it is instantiated. Your uc driver seems to ignore the option. Is there a way to specify this option in the uc driver???

@KamilMroczek
Copy link

Love these notes bahahahahaha

@Wizya
Copy link

Wizya commented Nov 14, 2023

I get the following error
AttributeError: 'Driver' object has no attribute 'command_executor'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet