2021-03-30 23:21:46 (edited by Turkce_Rap 2021-03-30 23:22:27)

Why do i suppose to get this Selenium error? it's windows os
btw. i've used double slashes instead of backslashes

Thumbs up

2021-03-30 23:22:51

Uh... I have no idea what you are trying to doo. No code, no information, no error code...

2021-03-30 23:59:33

yeah, you need to post the error.  Also, you will probably have better luck on Stack Overflow or something.

My Blog
Twitter: @camlorn38

2021-03-31 13:46:21

Code is here:
from selenium import webdriver
import time

dpath = "C://Users//masku//Documents//driver.exe"
browser = webdriver.Chrome(executable_path = dpath)
driver.get = ("http://http://forum.audiogames.net/")
time.sleep(5)
driver.window_minimize
printed = driver.page_source
print(printed)
driver.quit()

Doesn't work propperly.

Thumbs up

2021-03-31 15:28:02

I'd imagine the first problem is here:
driver.get = ("http://http://forum.audiogames.net/")
As you have two http:// it probably throws it off somewhat, but that's about the best advice you'll get without showing the error too :0

Nathan Smith
Managing Director of Nathan Tech
It's not disability
It's ability!

2021-03-31 21:32:05 (edited by Turkce_Rap 2021-03-31 21:35:39)

i will post  the full output here but, what i understand from the error that Selenium is unable to find chrome driver although boath the script that i've posted above and driver are in the same foulder. i've tried to insert path within boath using double slashes or either double backslashes. still no luck.

                                                                    C:\Users\account>python C:\Users\account\Documents\Test4.py                                                                Traceback (most recent
call last):                                                                                     
  File "C:\Users\account\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\common\service.py", l
ine 72, in start                                                                                                        self.process = subprocess.Popen(cmd,
env=self.env,                                                                 
  File "C:\Users\account\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 947, in __init__                 
    self._execute_child(args, executable, preexec_fn, close_fds,                                                       
  File "C:\Users\account\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1416, in _execute_child          graphic 738     hp, ht, pid, tid
= _winapi.CreateProcess(executable, args,                                                         
FileNotFoundError: [WinError 2] The system cannot find the file specified                                               
                                                                                                                        During handling of the
above exception, another exception occurred:                                                     
                                                                                                                       
Traceback (most recent call last):                                                                                      graphic 738   File "C:\Users\account\Documents\Test4.py",
line 3, in <module>                                                         
    browser = webdriver.Chrome(executable_path=driver_path)                                                             
  File "C:\Users\account\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\chrome\webdriver.py",graphic 738  line 73, in __init__
                                                                                                 
    self.service.start()                                                                                               
  File "C:\Users\account\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\common\service.py", lgraphic 738 ine 81, in start   
                                                                                                   
    raise WebDriverException(                                                                                           
selenium.common.exceptions.WebDriverException: Message: 'driver.exe' executable needs to be in PATH. Please see https://
sites.google.com/a/chromium.org/chromedriver/home

Thumbs up

2021-03-31 22:11:59

@6, It told you exactly what you needed. Put the location of the driver in your PATH environment variable.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

Thumbs up

2021-03-31 22:21:52

@7
it's already there. What do i miss?

Thumbs up

2021-04-03 10:00:35

Guys. Chrome now shows up blank page instead. Can You check it out?

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
options = webdriver.ChromeOptions()
options.binary_location = r"C:\Program Files\Google\Chrome\Application\chrome.exe"
chrome_driver_path = r"C:\Program Files\Google\Chrome\Application\chrome.exe"

browser = webdriver.Chrome(chrome_driver_path, options=options)
driver_path = r"C:\Users\masku/Documents"
browser = webdriver.Chrome(executable_path=driver_path)
time.wait(5)
driver.get("http://eksisozluk.com/")
driver.title()
driver.quit()

Thumbs up