The issues illustrated likely have less to do with Python than with
Selenium (or even Firefox - depending how far back we need to go).
That and our fate with the many web-search engines prioritising
'authoritative sources' in their results. Such definition includes
'clicks' over time. It fails to distinguish (in our case) that software
is improved/changes over time, and 'the old stuff' amongst the plethora
of web-pages becomes 'wrong'.
Plea: every web page should be dated, and all software-related
publications include version numbers (just as your posts do here. Well
On 17/10/2021 05.02, Akkana Peck wrote: > 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
> but how do you create one, or use it to reference a specific profile?
> I haven't been able to find any examples.
Some of the confusion may have been caused by the fact that there are
several 'moving parts', and all have had version upgrades but must still
'play nicely together'.
Secondly, when we use 'alpha' or other pre-release versions of software,
it is referred-to as "the bleeding edge" for good reason! In this case,
a scan of the repo's history will elicit a groan
Way forward/check list:
- upgrade to the *released* (4.0.0) version of Selenium
- upgrade Python (likely already done)
- upgrade Python-binding (https://pypi.org/project/selenium/4.0.0/
- ensure Firefox/Gecko-engine is compatible (?v48+ which happened long,
Some of the question(s) may be answered under "Firefox Legacy"
However, going backwards is an awkward way to make progress!
The 'new' method of setting a Custom Profile can be found in the docs
NB don't know when they were actually released but see "Last modified"
date, and don't feel too bad!
If you're interested in getting down-and-dirty with the API, there are
Finally, (Warning: un-read, so un-tested) I recalled that my 'reading
pile' includes "How to Create Firefox Profile in Selenium WebDriver"
*may* offer hints about the 'new' handling of FF profiles. Again, YMMV!