I'm trying to execute selenium script. I have defined the wait
variable, but still code is returning the error. My main issue is that, I'm able to run this on my machine, but when I tried in my colleagues machine. It is throwing this error. I dont know why I have given the chrome executable path. I have installed every package used in my project. Please help me
I have imported all these:
import os
import sys
os.system('pip3 install selenium')
os.system('pip3 install pandas')
os.system('pip3 install mysql-connector-python')
os.system('pip3 install webdriver_manager')
import time
#from webdriver_manager.chrome import ChromeDriverManager
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as
EC
from selenium.webdriver.common.keys import Keys
import mysql.connector
import getpass
from mysql.connector import connect, Error
import pandas as pd
import multiprocessing as mp
import csv
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_options.add_argument('--start-maximized')
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
DRIVER_BIN = os.path.join(PROJECT_ROOT, "chromedriver")
os.system('xattr -d com.apple.quarantine chromedriver')
driver = webdriver.Chrome(executable_path=DRIVER_BIN,
options=chrome_options)
This is my wait variable,
wait = WebDriverWait(driver, 100)
error:
Traceback (most recent call last):
File "main.py", line 160, in <module>
tenant = wait.until(EC.visibility_of_element_located((By.NAME, "tenantsearch")))
NameError: name 'wait' is not defined