Selenium py3.8+ DepreciationWarnings - where to find doc to update code?

Akkana Peck akkana at shallowsky.com
Sat Oct 16 12:02:39 EDT 2021


jkk writes:
> Selenium 3.141+
> python 3.8+
> ubuntu 20.04 or windows 10
> 
> I'm trying to upgrade code from py3.6+ to py3.8+ and I'm getting several DepreciationWarnings.
> 
> Can someone point me to where I can find the documentation that explains how to to remedy these warnings. What are the new preferred coding practices?

I've also been looking for that (Selenium 4.0.0a1, Python 3.9.5,
Ubuntu 21.04). For instance:

>>> from selenium import webdriver
>>> profiledir = "/path/to/profile/dir"
>>> driver = webdriver.Firefox(firefox_profile=profiledir)
<stdin>:1: DeprecationWarning: firefox_profile has been deprecated, please pass in a Service object

What is a Service object and how do you use it to pass in profiles?
I've found API references like
https://www.selenium.dev/selenium/docs/api/rb/Selenium/WebDriver/Service.html
https://selenium-python.readthedocs.io/api.html#module-selenium.webdriver.common.service
but how do you create one, or use it to reference a specific profile?
I haven't been able to find any examples. 

        ...Akkana


More information about the Python-list mailing list