Since there are many opportunities to install Selenium Basic, I made it a manual. This article is for Windows 10 (64bit) users who want to do web scraping with Python.
Please refer to the following article for how to install Python. https://qiita.com/ssbb/items/b55ca899e0d5ce6ce963
This time, we will use Google Chrome for web scraping, so please install Google Crome in advance.
The official Selenium Basic website (https://florentbr.github.io/SeleniumBasic/) explains as follows. In short, it's okay to think of it as a file needed for web scraping.
Description It makes it possible to automate web browsing using Excel and VBA code or using a simple VBS file executed by double-clicking on it. User's actions can be recorded using the Firefox plugin named "Selenium IDE" and translated to VBA or VBS with the provided formatters.
Go to the Selenium Basic official website (https://florentbr.github.io/SeleniumBasic/) and click [Release page] in the middle of the page.
Click the exe file to download it.
When the download is complete, launch the exe file. When the Welcome to the Selenium Basic Setup Wizard and the Setup Wizard appear, click Next.
You will be asked to accept the license. Check [I accept the agreement] and click [Next].
Leave the default components to install and click Next.
If you are satisfied with the installation contents, click [Install].
If [Completing the Selenium Basic Setup Wizard] is displayed, the installation was successful, so click [Finish] to close it.
The web driver for Google Chrome included with Selenum Basic is not compatible with the latest version of Google Chrome. Therefore, download the Chrome Driver with the same version as your Google Chrome from the following page.
ChromeDriver - WebDriver for Chrome https://sites.google.com/a/chromium.org/chromedriver/downloads
The version of Google Chrome I'm using is "87.0.4280.88", so click "Chrome Driver 87.0.4280.88".
Since the Windows version of Chrome Driver is required, click "chromedriver_win32.zip".
After the download is complete, unzip the zip file and place "chromedriver.exe" in any directory.
(Example) Create a folder called "ChromeDriver" directly under the C drive and place "chromedriver.exe"
Start the command prompt and execute the following command.
pip install selenium
If [Successfully installed selenium] is displayed, the installation is successful.
Start the command prompt and execute the following command. [executable_path] should be the directory path where the Chrome Driver is located.
python
from selenium import webdriver
webdriver.Chrome(executable_path=r'C:\ChromeDriver\chromedriver.exe')
After outputting [DevTools listening on ws ... (omitted)], if the browser is started for a while, it is successful.
The methods used in actual web scraping are summarized below, so I hope you find it helpful.
[2021 version] Python + Selenium Frequently used operation method summary https://qiita.com/ssbb/items/306ec9a1dbecd77d001b
Thank you for reading to the end!
Recommended Posts