Comments (3)
@15975518086, thank you for creating this issue. We will troubleshoot it as soon as we can.
Info for maintainers
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template
label.
If the issue is a question, add the I-question
label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted
label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-*
label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer
label.
Thank you!
from selenium.
Hi!
I encountered the same problem when trying to download a zip file.
Also in the process of debugging I catch another error message here (maybe it help:
Operating System: Manjaro Linux
Selenium version: 4.21
Python version: 3.12
Browsers: Chrome , Firefox, Edge (latest versions of selenium/standalone)
Traceback:
tests/modules/test_internal_export.py:104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py:1155: in download_file
zip_ref.extractall(target_directory)
../../../.pyenv/versions/3.12.0/lib/python3.12/zipfile/__init__.py:1720: in extractall
self._extract_member(zipinfo, path, pwd)
../../../.pyenv/versions/3.12.0/lib/python3.12/zipfile/__init__.py:1778: in _extract_member
shutil.copyfileobj(source, target)
../../../.pyenv/versions/3.12.0/lib/python3.12/shutil.py:203: in copyfileobj
while buf := fsrc_read(length):
../../../.pyenv/versions/3.12.0/lib/python3.12/zipfile/__init__.py:978: in read
data = self._read1(n)
../../../.pyenv/versions/3.12.0/lib/python3.12/zipfile/__init__.py:1046: in _read1
data += self._read2(n - len(data))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <zipfile.ZipExtFile [closed]>, n = 3094
def _read2(self, n):
if self._compress_left <= 0:
return b''
n = max(n, self.MIN_READ_SIZE)
n = min(n, self._compress_left)
data = self._fileobj.read(n)
self._compress_left -= len(data)
if not data:
> raise EOFError
E EOFError
../../../.pyenv/versions/3.12.0/lib/python3.12/zipfile/__init__.py:1081: EOFError
Docker-compose file
version: '3'
services:
chrome:
image: selenium/standalone-chrome
shm_size: 2gb
ports:
- 4444:4444 # Selenium service
- 5900:5900 # VNC server
- 7900:7900 # VNC browser client
environment:
- SE_OPTS=--enable-managed-downloads true
from selenium.
We are also experiencing the same issue...
The root issue, is that it's writing the zip-file content with the same name of the desired file, when it starts to uncompress, the "zip" file get's overwritten and then the file goes empty resulting with the EOF
exception
ATM we are bypassing it by calling the self.execute
directly with a similar solution to what millin did in his PR
def __download_file(self, file_name: str, target_directory: str) -> None:
if not os.path.exists(target_directory):
os.makedirs(target_directory)
contents = self.execute(Command.DOWNLOAD_FILE, {"name": file_name})["value"]["contents"]
zip_target_file = os.path.join(target_directory, f"{file_name}.zip")
with open(zip_target_file, "wb") as file:
file.write(base64.b64decode(contents))
with zipfile.ZipFile(zip_target_file, "r") as zip_ref:
zip_ref.extractall(target_directory)
os.remove(zip_target_file)
from selenium.
Related Issues (20)
- [π Bug]: Unable to obtain driver for firefox using Selenium Manager HOT 12
- [π Bug]:error sending request for url (https://chromedriver.storage.googleapis.com/LATEST_RELEASE): error trying to connect: θΏη¨δΈ»ζΊεΌΊθΏ«ε ³ιδΊδΈδΈͺη°ζηθΏζ₯γ (os error 10054) HOT 7
- [π Bug]: ChromiumOptions: android-specific options are removed after merge HOT 3
- [π Bug]: Use "GetScreenshot" method after expand combobox, it is collapsed. HOT 6
- [π Feature]: [java] BiDi Add an ability to add headers in BeforeRequestSent HOT 3
- [π Bug]: getAttribute and GetDomAttribute returns null HOT 5
- [π Feature]: Firefox and Safari does not support virtual_authenticator HOT 4
- [π Bug]: ValueError: ZIP does not support timestamps before 1980 HOT 7
- [π Bug]: Chrome not open in Windows Server 2022 (azure pipeline self hosted agent) via chromedriver.exe in .NET 6/8 app HOT 13
- [π Bug]: How to connect runnning firefox to debug HOT 3
- [π Bug]: Getting unwanted script error randomly while running selenium script with CRM dynamics 365 HOT 4
- [π Bug]: Python, Pytest - download.default_directory is not working when --headless=new HOT 5
- [π Bug]: Selenium Manager returns wrong browser-path if browser-version and browser-path sent HOT 11
- [π Bug]: Selenium manager with --browser-path parameter downloads browser any way HOT 6
- [π Bug]: selenium.common.exceptions.InvalidArgumentException: Message: binary is not a Firefox executable HOT 4
- [π Bug]: [GRID] logging.properties is ignored when trying to remove stack trace errors from Logs HOT 1
- [π Bug]: Using selenium-devtools-v123 with chrome 124.0.6367.201 is throwing no such method error on createSession method HOT 8
- [π Bug]: a value is required for '--proxy ' but none was supplied with ProxyType.DIRECT HOT 10
- [π Feature]: image-comparison HOT 4
- [π Bug]: Selenium Manager process exited abnormally with 65 code HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from selenium.