简体   繁体   English

我如何知道要在我的 VPS 上安装哪个 Chrome 二进制文件?

[英]How do I know which Chrome binary to install on my VPS?

I am attempting to do some web scraping from my VPS and I have already installed selenium and the chromedriver, however, now it looks like I need the Chrome binary in order to make everything work as expected.我正在尝试从我的 VPS 中抓取一些 web 并且我已经安装了 selenium 和 chromedriver,但是,现在看起来我需要 Chrome 二进制文件才能使一切按预期工作。

I am on a Linux private server, how do I which binary to install to make my scraping work?我在 Linux 私人服务器上,我如何安装哪个二进制文件以使我的抓取工作?

Install any Chrome version with automatic update enabled or not.安装任何启用或未启用自动更新的 Chrome 版本。

Download it here:在这里下载:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

Install (Debian):安装(Debian):

sudo apt install ./google-chrome-stable_current_amd64.deb

Install (Ubuntu):安装(Ubuntu):

sudo dpkg -i google-chrome-stable_current_amd64.deb

Then use this package Webdriver Manager for Python然后使用这个 package Webdriver Manager for Python

How to install it如何安装它

pip3 install webdriver-manager

How to use it如何使用它

from selenium import webdriver

from webdriver_manager.chrome import ChromeDriverManager

with webdriver.Chrome(executable_path=ChromeDriverManager().install()) as driver:
   ...

The package will identify the Chrome version installed and will fetch on github the proper driver binary. package 将识别已安装的 Chrome 版本,并将在 github 上获取正确的驱动程序二进制文件。 (If needed) (如果需要的话)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pip install letencrypt,我如何知道需要哪些软件包? - pip install letencrypt, how do I know which packages are needed? 我如何知道我的应用程序支持哪些版本的依赖项? - How do I know which versions of dependencies my application supports? 我如何知道哪个客户端正在将数据传输到我的服务器? - How do I know which client is transferring data to my server? 如何在我的 VPS 服务器 (hostinger) 中更改我的 DocumenRoot? - How do I change my DocumenRoot in my VPS server (hostinger)? 我的 pip 安装在其他 PATH 中,我不想我不知道如何修改它 - My pip install in other PATH and I do not want I do not know how to modify it Python:我怎么知道我的哪个依赖项正在尝试安装特定的 package? - Python : how can I know which one of my dependencies is attempting to install a specific package? 你怎么知道从哪个 conda 频道安装? - How do you know which conda channel to install from? 我怎么知道要安装哪个版本的 pip package? - How can I know which version of pip package to install? 为什么我不能在Centos 6 VPS上安装setuptools? - Why can't I install setuptools on my Centos 6 VPS? 我怎么知道我的Python进程绑定了哪个核心? - How do I know to which core my Python process has been bound?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM