为 linux 构建 chromedriver [英] Build chromedriver for linux
问题描述
我正在尝试从源代码构建 chromedriver 以用于 Linux 的 selenium.我使用本手册 https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md但是当我构建没有任何错误时,如果我从谷歌代码网站下载,我的 chromedriver 会少 2mb.这个 chromedriver 不适用于硒.只是空白错误.有人知道出了什么问题吗?谢谢你
I'm trying to build chromedriver from source for use in selenium for Linux. i use this manual https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md but when i build without any error my chromedriver less for 2mb that if i download form google code site. and this chromedriver not work with selenium. just blank error. Have someone any idea what wrong? Thank You
推荐答案
我们需要更多信息...这是一个 dockerfile(主要取自 这里)对我有用.大多数命令来自 chromium 构建文档.
We'd need more information... Here is a dockerfile (largely taken from here) that worked for me. Most of the commands come from the chromium build docs.
FROM ubuntu:14.04
# Install Chromium build dependencies.
RUN echo "deb http://archive.ubuntu.com/ubuntu trusty multiverse" >> /etc/apt/sources.list # && dpkg --add-architecture i386
RUN sudo apt-get update && apt-get install -qy git build-essential clang curl
# Install Chromium's depot_tools.
ENV DEPOT_TOOLS /usr/bin/depot_tools
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $DEPOT_TOOLS
ENV PATH $PATH:$DEPOT_TOOLS
RUN echo -e "
# Add Chromium's depot_tools to the PATH." >> .bashrc
RUN echo "export PATH="$PATH:$DEPOT_TOOLS"" >> .bashrc
RUN git config --global https.postBuffer 1048576000
# Download Chromium sources.
RUN fetch --nohooks --no-history chromium
WORKDIR /
RUN gclient runhooks
WORKDIR src
RUN build/install-build-deps.sh --no-prompt
RUN gn gen out/Release --args="is_debug=false"
RUN ninja -C out/Release chromedriver
RUN cp out/Release/chromedriver /usr/bin/chromedriver
WORKDIR /
这篇关于为 linux 构建 chromedriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!