I am in a corporate environment and the code is not able to access the chromedriver for me , to rectify this issue what I did I have stored the chromedriver in the same project directory and then gave that chromedriver to the program,
`C:\dev\LinkedIn_networking>python linkedIn.py
C:\dev\LinkedIn_networking\linkedIn.py:55: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
driver = webdriver.Chrome(ChromeDriverManager().install())
DevTools listening on ws://127.0.0.1:60722/devtools/browser/87b1c9f2-a2e0-4a63-84d5-3d4b1275d8c3
Traceback (most recent call last):
File "C:\dev\LinkedIn_networking\linkedIn.py", line 57, in
driver.find_element_by_id('username').send_keys(parameters.linkedin_username)
AttributeError: 'WebDriver' object has no attribute 'find_element_by_id'`
Instead of editing the source code to configure the program, an external file for the settings is ideal. This way, credentials never accidentally get committed. And updates to the code dont affect the credentials.
I personally like Pydantic Settings to handle settings but Dynaconf is another popular option. Configobj also deserves mention.
Have you thought about having the about of time slept between various actions be a random number within a range of seconds? This way, the behavior seems more human.