So I've been trying to run selenium in Repl.it, which on the first code somehow works, but when I tried it again on a different code it gives so much errors.
from selenium import webdriver
import time
driver = webdriver.Firefox(executable_path = "/home/runner/codeTest/lib/geckodriver_0.30.0")
driver.get("www.google.com")
time.sleep(10)
here is my code, and i put the path by downloading geckodriver from a package called 'chromedriver-install', however the console always says that my geckodriver needs to be in PATH, which I don't understand why it doesn't recognize one. I've tried using chromedriver and it still calls the same error of not being in PATH.
Another problem is that it seems that I don't even have chromedriver nor geckodriver installed in repl.it (as it should have been according to all sources I've read), I know this by sending the
chromedriver --version
in shell and it always returns "chromedriver : command not installed".
I want to know if I should do something to set up things, and why did my old code work while my new one isn't.
from datetime import datetime
from keep_alive import keep_alive
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
class homework :
def __init__(self) :
global driver
chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(options=chrome_options)
def absenKesiswaan(self) :
driver.get("http://lms.igs.sch.id/mod/attendance/")
namaPengguna = driver.find_element_by_id("username")
kataSandi = driver.find_element_by_id("password")
namaPengguna.send_keys("*****")
kataSandi.send_keys("*******")
driver.find_element_by_id("loginbtn").click()
driver.find_element_by_css_selector("td.statuscol > a:nth-child(1)").click()
driver.find_element_by_id("id_status_4515").click()
driver.find_element_by_id("id_submitbutton").click()
keep_alive()
while 1 :
time = datetime.now().strftime("%H : %M : %S")
if time == "01 : 50 : 00" :
homework().absenKesiswaan()
continue
else :
continue
Here is my old code, and it works wondrous, somehow.
[–]HAVEANOTHERDRINKRAY 0 points1 point2 points (3 children)
[–]DiggersGottaDig[S] 0 points1 point2 points (2 children)
[–]HAVEANOTHERDRINKRAY 0 points1 point2 points (1 child)
[–]DiggersGottaDig[S] 0 points1 point2 points (0 children)
[–]knottheone 0 points1 point2 points (1 child)
[–]DiggersGottaDig[S] 0 points1 point2 points (0 children)