0
votes
#Function to click a button on DocDroid website

def sendpdf():
    import selenium
    driver=webdriver.Chrome()
    driver.get('https://www.docdroid.net/')
    upload_box=driver.find_element_by_id('select')
    upload_box.click()

sendpdf()

if I add 'from selenium import webdriver' I get the following error:

Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child
    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):
  File "C:/Users/User/Desktop/Computer Projects/Virus/pdfsend.py", line 11, in <module>
    sendpdf()
  File "C:/Users/User/Desktop/Computer Projects/Virus/pdfsend.py", line 6, in sendpdf
    driver=webdriver.Chrome()
  File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
    self.service.start()
  File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

>>> 

I'm for some reason getting the following error:

NameError: name 'webdriver' is not defined

packages\selenium\webdriver\chrome\webdriver.py", line 73, in init self.service.start() File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

1
You should use from selenium import webdriverSushilG
I get another huge error, which I can't paste in this comment.Moin
Have you installed selenium using pip install seleniumSushilG
yes, I did do that.Moin
Please paste the error in questionSushilG

1 Answers

0
votes

You need to add chromedriver in your system PATH, you can download it from here