How to Install Selenium Python into a Virtual Environment (venv) and setup VSCode / ChromeDriver

preview_player
Показать описание
This video tutorial shows how to:
- Install Python (the latest version at the time of recording) on Windows.
- Create a virtual Python environment with venv. A virtual environment allows us to isolate libraries, like Selenium, depending on project needs.
- Install the Selenium Python library into the new virtual environment.
- Install Python extensions in VSCode. Particularly, the Jupyter Notebook extension. Jupyter Notebook allows Python code to run in blocks, rather than having to rerun the whole script after every code change.
- Run a quick test in VSCode to launch a browser and go to a test URL.
With the above steps complete, we are prepared for browser automation, web application testing automation, and web scraping.

Рекомендации по теме
Комментарии
Автор

After spending so many hours trying to figure out why selenium and chrome isn't working, i finally found the best video to fix my issues. Thank you for the great work. Very helpful !

cristinanastase
Автор

thank you! Watched a few videos now about this topic, but yours is the best, because its short and describes the process from start till end! Perfect on point!

kirild
Автор

Thank you so much! I have been trying so long to get selenium to work

drewvandenbosch
Автор

OMG thanks so much. I have been spending 1 h on it. This video eventually helps me to solve the issue

qixinxiao
Автор

omg ! finally i found your solution. thank you

mmbb.
Автор

hi Johnny, Such a nice and to the perfect guide to achieve my objective, wanna give you million like but unfortunately i can only one... with love

duarfeht
Автор

please let me know why selenium stop working, means deactivate after installation...codes become colorless(white) can you please giude?

duarfeht
Автор

my code still doesn't work, i have this error:
AttributeError Traceback (most recent call last)
File API\.venv\Lib\site-packages\selenium\webdriver\common\driver_finder.py:38, in DriverFinder.get_path(service, options)
37 try:
---> 38 path = if path is None else path
39 except Exception as err:

File API\.venv\Lib\site-packages\selenium\webdriver\common\selenium_manager.py:76, in SeleniumManager.driver_location(self, options)
69 """Determines the path of the correct driver.
70
71 :Args:
72 - browser: which browser to get the driver path for.
73 :Returns: The driver path to use
74 """
---> 76 browser =
78 args = [str(self.get_binary()), "--browser", browser]

AttributeError: 'str' object has no attribute 'capabilities'

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last)
API\selenium_text.ipynb Cell 1 line 3
1 from selenium import webdriver
2 API\chromedriver.exe"
...
---> 40 msg = f"Unable to obtain driver for using Selenium Manager."
41 raise NoSuchDriverException(msg) from err
43 if path is None or not Path(path).is_file():

AttributeError: 'str' object has no attribute 'capabilities'

mr.k
Автор

i cant get into scripts it says system couldnt find the path pls help

burhankiran
Автор

hey man I need some help, could you give me your discord?

strongmen
visit shbcf.ru