首页 > 系统相关 >Ubuntu ARM版本如何使用selenium

Ubuntu ARM版本如何使用selenium

时间:2023-06-23 15:11:31浏览次数:57  
标签:webdriver service selenium install Ubuntu import chromium ARM

1. Python模块安装

pip install selenium

pip install webdriver-manager

 

2. Chromium和Driver安装

sudo apt update && sudo apt install chromium chromium-driver

 

3. 测试代码

# selenium 4
import shutil
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeOrChromiumService
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.utils import ChromeType

# don't forget in your installation script : 
# sudo apt update && sudo apt install chromium chromium-driver
if (shutil.which('chrome') or shutil.which('chromium')) and shutil.which('chromedriver') :
    service = ChromeOrChromiumService()
else:
    service = ChromeOrChromiumService(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install())
driver = webdriver.Chrome(service=service)

 

 

参考链接:

1.Selenium: geckodriver executable needs to be in PATH? | ScrapingBee

2.Can support ARM64 for chromium? · Issue #436 · SergeyPirogov/webdriver_manager (github.com)

 

标签:webdriver,service,selenium,install,Ubuntu,import,chromium,ARM
From: https://www.cnblogs.com/hicoffee/p/17499177.html

相关文章

  • Ubuntu-Python创建虚拟环境
    要在Ubuntu上使用VSCode为Python创建一个虚拟环境,可以按照以下步骤进行:打开终端(Ctrl+Alt+T)。安装Python的虚拟环境工具(如果尚未安装):sudoaptinstallpython3-venv在终端中进入您希望创建虚拟环境的目录:cd/path/to/directory请将/path/to/direct......
  • Ubuntu添加新用户并授权root
    打开终端。您可以使用快捷键Ctrl+Alt+T来打开终端,或者在应用程序菜单中搜索"终端"并打开它。在终端中,输入以下命令以使用超级用户权限登录(您需要输入当前用户的密码):sudo-i输入以下命令来添加新用户,将newuser替换为您想要设置的实际用户名:addusernewuser按......
  • 甲骨文Ubuntu ARM安装桌面版
    1、更新系统aptupdate-y;aptupgrade-y2、安装桌面aptinstallubuntu-desktop-y安装桌面这个过程比较慢,2核12G耗时6分钟3、安装xrdpaptinstallxrdp-y3、添加用户、重启Xrdp、开机启动adduserxrdpssl-certsystemctlrestartxrdpsystemctlstatusxrdp......
  • Ubuntu提示【Authentication is required to create a color profile/managed device
    1.安装vimaptinstallvim-y2.修改文件 vim/etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla3.粘贴以下内容[AllowColordallUsers]Identity=unix-user:*Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-......
  • ubuntu apt源配置
    cd/etc/aptvi sources.listdebhttp://mirrors.aliyun.com/ubuntu/trustymainmultiverserestricteduniversedebhttp://mirrors.aliyun.com/ubuntu/trusty-backportsmainmultiverserestricteduniversedebhttp://mirrors.aliyun.com/ubuntu/trusty-proposedmai......
  • mac arm64交叉编译 x84_64
    toolchain_x86_64.cmakeset(CMAKE_SYSTEM_NAMEDarwin)#设置操作系统为Monterey(macOS)set(CMAKE_SYSTEM_PROCESSORx86_64)#设置目标处理器架构为x86_64set(CMAKE_OSX_ARCHITECTURESx86_64)set(CMAKE_CROSSCOMPILINGtrue)#设置交叉编译工具链路径set(CMAKE_C_CO......
  • ubuntu10.10 下安装android 2.2开发环境
    一、安装Java6安装jre/jdksudoapt-getinstallsun-java6-binsun-java6-jresun-java6-jdk使用这个命令安装后,默认是安装在/usr/lib/jvm/ 目录下,以我为例,我这里是/usr/lib/jvm/java-6-sun-1.6.0.24目录,/usr/lib/jvm/下还有一个快捷方式java-6-sun有时候会安装多个jdk,......
  • 安装PyCharm
    转载请注明来源:http://www.eword.name/Author:ewordEmail:[email protected]安装PyCharm一、下载PyCharmPyCharm是一款功能强大的Python编辑器,具有跨平台性,PyCharm的下载地址:http://www.jetbrains.com/pycharm/download/#section=windows,进入该网站后,我们会看到如下界......
  • Ubuntu22.04的配置
    1、下载堡塔远程工具,连接服务器2、wget-Oinstall.shhttps://download.bt.cn/install/install-ubuntu_6.0.sh&&sudobashinstall.shed8484bec   安装宝塔3、安装环境工具   4、检测有提权漏洞    查看可以升级的版本号:aptinstalllinux-image可......
  • 安装PyCharm
    转载请注明来源:http://www.eword.name/Author:ewordEmail:[email protected]安装PyCharm一、下载PyCharmPyCharm是一款功能强大的Python编辑器,具有跨平台性,PyCharm的下载地址:http://www.jetbrains.com/pycharm/download/#section=windows,进入该网站后,我们会看到如下界......