安裝Selenium及Webdriver
首先,利用以下指令安裝Python的Selenium套件:
$ pip install selenium
Windows PowerShell
Copyright (C) Microsoft Corporation. 著作權所有,並保留一切權利。
請嘗試新的跨平台 PowerShell https://aka.ms/pscore6
PS C:\xampp\htdocs\kkPython001> pip install selenium
Collecting selenium
Downloading selenium-4.3.0-py3-none-any.whl (981 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 981.4/981.4 KB 2.2 MB/s eta 0:00:00
Requirement already satisfied: urllib3[secure,socks]~=1.26 in c:\users\blueqoo\appdata\local\programs\python\python310\lib\site-packages (from selenium) (1.26.9)
Collecting trio-websocket~=0.9
Downloading trio_websocket-0.9.2-py3-none-any.whl (16 kB)
Collecting trio~=0.17
Downloading trio-0.21.0-py3-none-any.whl (358 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 359.0/359.0 KB 21.8 MB/s eta 0:00:00
Collecting outcome
Downloading outcome-1.2.0-py2.py3-none-any.whl (9.7 kB)
Collecting sortedcontainers
Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Requirement already satisfied: idna in c:\users\blueqoo\appdata\local\programs\python\python310\lib\site-packages (from trio~=0.17->selenium) (3.3)
Collecting async-generator>=1.9
Downloading async_generator-1.10-py3-none-any.whl (18 kB)
Collecting sniffio
Downloading sniffio-1.2.0-py3-none-any.whl (10 kB)
Requirement already satisfied: attrs>=19.2.0 in c:\users\blueqoo\appdata\local\programs\python\python310\lib\site-packages (from trio~=0.17->selenium) (21.4.0)
Collecting cffi>=1.14
Downloading cffi-1.15.1-cp310-cp310-win_amd64.whl (179 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 179.1/179.1 KB 2.7 MB/s eta 0:00:00
Collecting wsproto>=0.14
Downloading wsproto-1.1.0-py3-none-any.whl (24 kB)
Requirement already satisfied: certifi in c:\users\blueqoo\appdata\local\programs\python\python310\lib\site-packages (from urllib3[secure,socks]~=1.26->selenium) (2021.10.8)
Collecting pyOpenSSL>=0.14
Downloading pyOpenSSL-22.0.0-py2.py3-none-any.whl (55 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.8/55.8 KB 2.8 MB/s eta 0:00:00
Collecting cryptography>=1.3.4
Downloading cryptography-37.0.4-cp36-abi3-win_amd64.whl (2.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 11.0 MB/s eta 0:00:00
Collecting PySocks!=1.5.7,<2.0,>=1.5.6
Downloading PySocks-1.7.1-py3-none-any.whl (16 kB)
Collecting pycparser
Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 KB 2.3 MB/s eta 0:00:00
Collecting h11<1,>=0.9.0
Downloading h11-0.13.0-py3-none-any.whl (58 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.2/58.2 KB 1.5 MB/s eta 0:00:00
Installing collected packages: sortedcontainers, sniffio, PySocks, pycparser, outcome, h11, async-generator, wsproto, cffi, trio, cryptography, trio-websocket, pyOpenSSL, selenium
Successfully installed PySocks-1.7.1 async-generator-1.10 cffi-1.15.1 cryptography-37.0.4 h11-0.13.0 outcome-1.2.0 pyOpenSSL-22.0.0 pycparser-2.21 selenium-4.3.0 sniffio-1.2.0 sortedcontainers-2.4.0 trio-0.21.0 trio-websocket-0.9.2 wsproto-1.1.0
WARNING: You are using pip version 22.0.4; however, version 22.2 is available.
You should consider upgrading via the 'C:\Users\blueqoo\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.
PS C:\xampp\htdocs\kkPython001>
前往Python套件儲存庫PyPI(Python Package Index),輸入Selenium進行查詢,如下圖:
待續
期待您的留言

Comments