linux selenium chrome 加载用户配置文件

发布时间:2020-05-14 14:19:27编辑:Run阅读(118)

    linux selenium chrome 加载用户配置文件


    需要安装linux桌面环境(系统版本: CentOS Linux release 7.6.1810 (Core))

    yum groupinstall "GNOME Desktop" "Graphical Administration Tools"


    获取当前系统启动模式

    [root@crawler-03 etc]# systemctl get-default

    multi-user.target


    查看配置文件


    [root@crawler-03 etc]# cat /etc/inittab 

    # inittab is no longer used when using systemd.

    # ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.

    # Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target

    # systemd uses 'targets' instead of runlevels. By default, there are two main targets:

    # multi-user.target: analogous to runlevel 3

    # graphical.target: analogous to runlevel 5

    # To view current default target, run:

    # systemctl get-default

    # To set a default target, run:

    # systemctl set-default TARGET.target


    设置桌面方式启动

    systemctl set-default TARGET.target


    启动服务器

    reboot


    linux安装google浏览器

    wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

    yum install ./google-chrome-stable_current_*.rpm


    google在linux中运行需要添加--no-sandbox

    which google-chrome

    vim /bin/google-chrome

    exec -a "$0" "$HERE/chrome" "$@" --no-sandbox


    安装google驱动

    wget https://chromedriver.storage.googleapis.com/81.0.4044.69/chromedriver_linux64.zip

    unzip chromedriver_linux64.zip 

    mv chromedriver /usr/bin/chromedriver

    chmod +x /usr/bin/chromedriver


    用VNC或者xmanager连接linux桌面(方式自行baidu)

    打开google浏览器,访问chrome://version/

    image.png


    /root/.config/google-chrome/Default 就是用户配置文件了









关键字

上一篇: python selenium chrome 加载本地用户配置

下一篇: 没有了