问题
FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver' I am using docker to build my app on ubuntu server.
Dockerfile:
FROM python:latest
WORKDIR /src
COPY requirements.txt /src
RUN pip install -r requirements.txt
COPY . /src
docker-compose.yml :
version: '3.1'
services:
tgbot:
container_name: bot
build:
context: .
command: python app.py
restart: always
environment:
WEBAPP_PORT: 3001
env_file:
- ".env"
ports:
- 8443:3001
networks:
- botnet
volumes:
- ./:/src
chrome:
image: selenium/standalone-chrome:latest
hostname: chrome
networks:
- botnet
privileged: true
networks:
botnet:
driver: bridge
requirements.txt include arsenic~=20.9
My python code with arsenic that works on my windows PC (i have chrome installed, +chromedriver file in app folder):
from arsenic import get_session, keys, browsers, services
async def arsenic_scraper(url):
service = services.Chromedriver()
browser = browsers.Chrome()
async with get_session(service, browser) as session:
await session.get(url)
来源:https://stackoverflow.com/questions/65196914/arsenic-with-chromedriver-on-ubuntu-filenotfounderror-errno-2-no-such-file-o