I have been trying to automate my firefox browser in Kali linux. I installed selenium and geckdriver and running this simple script:
from selenium import webdriver
browser = webdriver.Firefox('/usr/bin/')
browser.get('www.duckduckgo.com')
#I saw a video where the guy mentioned that we do not have to use the path of the browser (doesn't work for me)
After running this simple script in python as
python3 script.py
the terminal freezes at:
script.py:4: DeprecationWarning: firefox_profile has been deprecated, please pass in a Service object
After Interrupting the process, it delivers the following error:
browser = webdriver.Firefox('/usr/bin/')
^CTraceback (most recent call last):
File "script.py", line 4, in <module>
browser = webdriver.Firefox('/usr/bin/')
File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox/webdriver.py", line 155, in __init__
firefox_profile = FirefoxProfile(firefox_profile)
File "/usr/lib/python3/dist-packages/selenium/webdriver/firefox/firefox_profile.py", line 78, in __init__
ignore=shutil.ignore_patterns("parent.lock", "lock", ".parentlock"))
File "/usr/lib/python3.7/shutil.py", line 354, in copytree
copy_function(srcname, dstname)
File "/usr/lib/python3.7/shutil.py", line 266, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.7/shutil.py", line 122, in copyfile
copyfileobj(fsrc, fdst)
File "/usr/lib/python3.7/shutil.py", line 79, in copyfileobj
buf = fsrc.read(length)
KeyboardInterrupt
I really do not understand what does it mean. Can you please help me fix it? Thanks in advance.
PS: I also installed geckodriver v0.26
and put in the same directory as the script.py
file.