Selenium Python bindings provide a convenient API to access Selenium WebDrivers like Firefox, Ie, Chrome, Remote etc. The current supported Python versions are 2.7, 3.5 and above.
Install Selenium Python
1. Install the latest stable version of Firefox:sudo apt install firefox
2. Updatesudo apt-get update
3. Install SeleniumFor Python2:
sudo pip install selenium
For Python3:sudo pip3 install selenium
4. Check the latest release of Geckodriver on the releases page and download itwget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
5. Extract the archive and move the executable to a location in your PATH:tar -xvf geckodriver-v0.19.1-linux64.tar.gzsudo mv geckodriver /usr/local/bin/
Code test Selenium Python
Run python first:
Code test:python3
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from bs4 import BeautifulSoup
import re
import pandas as pd
from tabulate import tabulate
import os
import time
import csv
import random
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Firefox()driver.implicitly_wait(30)url= 'vuinghichweb.blogspot.com'driver.get(url)driver.quit()
Have fun!
0 Comments