# download the webdriver
wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
# basic configuration when running selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-dev-shm-usage') # needed to be used on no GUI linux in order to work
url = 'https://ynet.co.il'
browser = webdriver.Chrome(executable_path=r'bin/chromedriver', options=chrome_options) # put the location of the webdriver
browser.get(url)
# find element
passEntry = browser.find_element_by_xpath('//*[@id="passwordInput"]/div/input')
# send keys to this element
passEntry.send_keys(password)
# print the text on the element
print(passEntry.text)
# refresh the browser
browser.refresh()
broweser.page_source