Coder Social home page Coder Social logo

breuerfelix / chromedriver-py Goto Github PK

View Code? Open in Web Editor NEW
50.0 50.0 17.0 13.07 MB

chromedriver self updated binaries for all platforms

Home Page: https://pypi.org/project/chromedriver-py/

License: Apache License 2.0

Python 100.00%
chromedriver cross-platform package pip pypi python

chromedriver-py's Introduction

chromedriver-py's People

Contributors

breuerfelix avatar brian316 avatar lemonez avatar lundstrj avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chromedriver-py's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/deploy.yaml
  • actions/checkout v4
  • actions/setup-python v5
pip_requirements
requirements.txt

  • Check this box to trigger a request for Renovate to run again on this repository

Latest chrome versions don't appear to be getting added on PyPI

Latest chrome versions don't appear to be getting added on PyPI.

chromedriver-py PyPI release history: https://pypi.org/project/chromedriver-py/#history

Latest version available currently on chromedriver-py PyPI page is 120.0.6099.109 Dec 18, 2023.

According to https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json the latest stable version is 121.0.6167.85 as well as dev and beta builds for 122 and 123.

I just noticed this today haven't had much time to look into it. I'm not sure if the latest stable build was just pushed recently to JSON or something. If so there might just be a delay in the PyPI package update. But I did do a google search and 121 stable apparently released Jan 17th so I'm not 100% sure if there is an issue with the project updating or not but might be worth checking. I'll check back on this soon.

Unable to run find binary after built to .exe

The python script to call the chrome browser can be run in .py format. However, it fails to run after built to .exe file. The error is as below: (I ran the script on window 10)

Traceback (most recent call last):
File "Assign_Pollvote.py", line 8, in
File "", line 1027, in _find_and_load
File "", line 1006, in find_and_load_unlocked
File "", line 688, in load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
File "chromedriver_py_init
.py", line 38, in
File "chromedriver_py_init
.py", line 33, in _get_filename
Exception: Couldn't find a binary for your system: windows / amd64. Please create an Issue on github.com/breuerfelix/chromedriver-py and include this Message.

image

Couldn't find a binary for your system: darwin / arm64.

Hello! After a recent chromedriver version bump, I am getting this message:

Couldn't find a binary for your system: darwin / arm64.

It appears that since 106.0.5249.61 the zip file name is now chromedriver_mac_arm64 instead of chromedriver_mac_m1.

Happy to help contribute a patch to help out.

image

vs

image

chromdriver_py binary missing after running pyinstaller

After running pyinstaller to create an exe of my project and running the .exe that pyinstaller spits out, I get the error: "Couldn't find a binary for your system: windows / amd64. Please create an Issue on github.com/breuerfelix/chromedriver-py and include this Message." I have an AMD Ryzen 7 7600X processor and I'm on Windows 11 if that matters. The issue comes from the line in my code below

"File "main.py", line 20, in
from chromedriver_py import binary_path

I'm not sure what breaks between before running pyinstaller and after, but the chromdriver_py binary seems to not get packaged with the .exe and placing the chromedriver.exe file into the dist or main folders that pyinstaller create for me, doesn't seem to work. Googling the error I quoted at the beginning only leads me here to where someone had a similar issue, but with an M1, which isn't my system. If you have any ideas, that'd be fantastic.

Follow up question to #26

Hello,

great that it works with cx_freeze.
I like pyinstaller because it creates a single executable.
Do you have any plans to fix this problem?

thanks,

Michael

Open chrome failed with error message "selenium.common.exceptions.WebDriverException: Message: Service /binbin/pymilvus-test/lib/python3.8/site-packages/chromedriver_py/chromedriver_linux64 unexpectedly exited"

chromedriver-py Version: 109.0.5414.25
machine version:
Linux version 4.18.0-372.16.1.el8_6.x86_64 ([email protected]) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC)) #1 SMP Wed Jul 13 15:36:40 UTC 2022

Reproduced script:

>>> from selenium import webdriver
>>> from selenium.webdriver.chrome.service import Service
>>> from chromedriver_py import binary_path
>>> service_object = Service(binary_path)
>>> driver = webdriver.Chrome(service=service_object)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/binbin/pymilvus-test/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
    super().__init__(
  File "/binbin/pymilvus-test/lib/python3.8/site-packages/selenium/webdriver/chromium/webdriver.py", line 103, in __init__
    self.service.start()
  File "/binbin/pymilvus-test/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 106, in start
    self.assert_process_still_running()
  File "/binbin/pymilvus-test/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 119, in assert_process_still_running
    raise WebDriverException(f"Service {self.path} unexpectedly exited. Status code was: {return_code}")
selenium.common.exceptions.WebDriverException: Message: Service /binbin/pymilvus-test/lib/python3.8/site-packages/chromedriver_py/chromedriver_linux64 unexpectedly exited. Status code was: 12

chromedriver_linux64 unexpectedly exited. Status code was: 127

Trying to run chromedriver in Google Cloud Run. Here is what the docker file looks like:

FROM python:3.7

ADD main.py /

RUN apt-get update
RUN apt-get install wget

# Install Chrome
#RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
#RUN dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install

COPY . /
RUN pip install --upgrade google-api-python-client
RUN pip install -r requirements.txt

EXPOSE XXXXX

CMD [ "python", "./main.py" ]

Any idea how to fix this error? In my requirements file I have chromedriver_py== 92.0.4515.43 mentioned. Any other dependencies that I need to install?

The issue seems to be originating from here:

browser = Chrome(executable_path=binary_path, options=opts)

Here's the options:

opts = Options()
	opts.add_argument("--no-sandbox")
	opts.add_argument("--headless")
	opts.add_argument('--disable-dev-shm-usage')
	opts.add_argument("--window-size=1920x1080")
	opts.add_argument(
	    "--user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.43 Safari/537.36'")
	opts.add_argument("--disable-gpu")
	opts.add_argument("--disable-extensions")
	opts.add_argument("--start-maximized")
	browser = Chrome(executable_path=binary_path, options=opts)

Issue with update lag between Chrome and chromedriver-py

Hello, sorry to bother you again.

My Google Chrome just now updated to Version 98.0.4758.102 (Official Build) (arm64) and there is a corresponding chromedriver in https://chromedriver.storage.googleapis.com/ but chromedriver-py has not yet been updated to include the new chromedriver.

I did see the readme section about github actions to trigger a new build for pushing a new version to pypi. I am guessing I'm not a developer and therefor cannot trigger the workflow.

Perhaps we have a way of running the workflow more often or ideally make it event driven, tied to whenever a new chrome release is made? (I'd also settle for being made a dev so I can trigger the workflow when necessary but I can understand how you'd prefer to keep the developer list short)

Programs using chromedriver_py exported to .exe by pyinstaller don't detect chromedriver_py binary

Error:
File "main.py", line 11, in
File "", line 1027, in _find_and_load
File "", line 1006, in find_and_load_unlocked
File "", line 688, in load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
File "chromedriver_py_init
.py", line 38, in
File "chromedriver_py_init
.py", line 33, in _get_filename
Exception: Couldn't find a binary for your system: windows / amd64. Please create an Issue on github.com/breuerfelix/chromedriver-py and include this Message.
[17892] Failed to execute script 'main' due to unhandled exception!

The binary is not added to the spec file generated by pyinstaller, manually adding it does not solve the issue.

Chrome-stable is v96, but this Chromedriver-py doesn't support

Google-chrome-stable is currently at version 96: https://www.ubuntuupdates.org/pm/google-chrome-beta .. but I can't figure out why this command doesn't work:

pip3 install chromedriver-py==96.0.4664.110

Response:

Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement chromedriver-py==96.0.4664.110 (from versions: 2.38, 2.45.2, 2.45.3, 2.46, 78.0.3904.11, 78.0.3904.70, 79.0.3945.16, 79.0.3945.36, 80.0.3987.16, 81.0.4044.20, 81.0.4044.69, 83.0.4103.14, 83.0.4103.39, 84.0.4147.30, 85.0.4183.38, 85.0.4183.83, 85.0.4183.87, 86.0.4240.22, 87.0.4280.20, 87.0.4280.88, 88.0.4324.27, 88.0.4324.96, 89.0.4389.23, 90.0.4430.24, 91.0.4472.19, 92.0.4515.43, 92.0.4515.107, 93.0.4577.15, 93.0.4577.63, 94.0.4606.41, 95.0.4638.10, 95.0.4638.17, 97.0.4692.20, 97.0.4692.36, 97.0.4692.37)
ERROR: No matching distribution found for chromedriver-py==96.0.4664.110

chromedriver-py has been updated recently and seems to support v97.. did it just skip v96? Thanks for any help in clarifying.

Exception: Couldn't find a binary for your system: Darwin / arm64

Exception: Couldn't find a binary for your system: Darwin / arm64. Please create an Issue on github.com/breuerfelix/chromedriver-py and include this Message.

This was attempted on a MBA M1 with Python 3.9.4 (I am helping a coworker setup my tool on this machine). The system is clearly Darwin and the machine is "arm64" so I'd assume that path simply isn't a file. As to why that is, I do not know.

I noticed you simplified the logic regarding M1 somewhat recently, could that have caused a regression?

I myself am on an identical machine and I do not have this issue (but I know my coworker has also setup Python 2.7 on his box (due to reasons)) so it isn't as bog standard as my own setup.

I'd be happy to help debug this, I just don't know what would be of use to us.

Unable to start server

Every time I try to use the driver it just says:

Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1680334266.938][SEVERE]: bind() returned an error: An attempt was made to access a socket in a way forbidden by its access permissions. (0x271D)
[1680334266.938][SEVERE]: bind() returned an error: An attempt was made to access a socket in a way forbidden by its access permissions. (0x271D)
Unable to start server with either IPv4 or IPv6. Exiting...

I even tried installing a previous version, but it didn't help. I would really appreciate some help!

Example code fails

Directly copied and ran example code using Python 3.10.2,

C:\Users\Cramik\Desktop>python test4.py Traceback (most recent call last): File "C:\Users\Cramik\Desktop\test4.py", line 4, in <module> service_object = Service(binary_path) NameError: name 'Service' is not defined

Fails to install from github on macos

pip install git+https://github.com/breuerfelix/chromedriver-py.git
Collecting git+https://github.com/breuerfelix/chromedriver-py.git
  Cloning https://github.com/breuerfelix/chromedriver-py.git to /private/var/folders/11/829w0h653zn4z81jgf0mv48r0000gp/T/pip-req-build-ulsmukns
  Running command git clone --filter=blob:none --quiet https://github.com/breuerfelix/chromedriver-py.git /private/var/folders/11/829w0h653zn4z81jgf0mv48r0000gp/T/pip-req-build-ulsmukns
  Resolved https://github.com/breuerfelix/chromedriver-py.git to commit 72d3ad828f6f60da93421e5a52b932dc700d2008
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/11/829w0h653zn4z81jgf0mv48r0000gp/T/pip-req-build-ulsmukns/setup.py", line 9, in <module>
          with open(CURRENT_VERSION_FILE) as f:
      FileNotFoundError: [Errno 2] No such file or directory: './CURRENT_VERSION.txt'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

travis push current version

travis is currently not pushing the latest version to GitHub.

the auto update works anyways, since it skips existing packages.
it would still be pretty if travis could update the latest version to the repo.

Couldn't find a binary for your system (EXE only issue)

Not really sure how much info is needed to help with this, but when turning into an EXE with auto-py-to-exe, this error persists. Works fine when running the .py file.

Traceback (most recent call list):
File "filename.py`, line 10, in <module>
from chomedriver_py import binary_path
File "<frozen importlib._bootstrap", line 1178, in _find_and_load
File "<frozen importlib._bootstrap", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module
File "chromedriver_py\__init__.py", line 49, in <module>
File "chromedriver_py\__init__.py", line 44, in _get_filename
Exception: Couldn't find a binary for your system: windows / amd64. Please create an Innsure on github.com/breuerfelix/chromedriver-py and include this Message.
[18412] Failed to execute script 'Filename' due to unhandle exception!

Libraries used

from lxml import etree
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from chromedriver_py import binary_path

import ctypes
import os
import re
import shutil
import time
import tkcalendar
import tkinter
import Widget_Constructor

Do we want logic to handle chrome - chromedriver-py missmatch?

Hello,

Long time fan by the way.

I've written a bit of logic to handle the times when my version of Chrome is higher than the current latest version that chromedriver-py can offer. Sometimes an outdated but still very recent version of chromedriver will still get the job done so I wrote code to handle that for my users.

Maybe other people would find that useful too?

I'd be happy to work with you to adapt my code to fit into this project.

Issue with using pyInstaller / auto-py-2-exe and chromedriver_py

Hello,
it is my first time using GitHub Issue, so I hope I don't mess it up.

I'm trying to convert a python file to an *.exe with "chromedriver_py" in it.

In PyCharm my program is working perfectly, no errors / exceptions or anything, but when I'm converting it to exe using PyInstaller or autopy2exe, no matter if it's onefile, or onedirectory (bundle) it throws me an error:

Traceback (most recent call last):
  File "testscript.py", line 25, in <module>
    from chromedriver_py import binary_path
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
  File "chromedriver_py\__init__.py", line 36, in <module>
  File "chromedriver_py\__init__.py", line 31, in _get_filename
Exception: Couldn't find a binary for your system: windows / amd64. Please create an Issue on github.com/breuerfelix/chromedriver-py and include this Message.

--

I'm importing it like this (with selenium, but you can ignore that, I guess):

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.chrome.service import Service
from subprocess import CREATE_NO_WINDOW
from chromedriver_py import binary_path  # chromedriver_py

And using it in code:

# Just a small test function
def test_func():
    chrome_options = Options()
    chrome_options.add_argument("--start-maximized")
    service = Service(binary_path)  # Getting the binary path of Chromedriver
    service.creationflags = CREATE_NO_WINDOW  # No cmd-prompt when selenium's working

    driver = webdriver.Chrome(options=chrome_options, service=service)

I've tried also to use --hidden-import with chromedriver_py as a pyInstaller option, sadly it also not worked.

Some details:

Python 3.10.0
PyInstaller 4.8
chromedriver_py >97, <98
selenium 4.1.0

I would be very, very, very thankful if you could help me out with this.

ChromeDriver support for Chrome v93

Latest ChromeDriver support up to version v92

v93.0.4577 of Chrome was released on the 31st of August, so chromedriver_py support isn't currently available.

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.