Issue on Statement seems to have no effect

Answered

Hi ,
   I face this issue during importing modules while using selenium . I could not able to see the suggestions from where to import  when I declare a class in this case i.e Service.
Here while keeping cursor on Service I can see only Statement seems to have no effect instead of ' Unresolved reference , Import this name '. Please help me with this so that I can easily import from the dropdowns / suggestions under that. 


Thanks ,
Sidd.
 

0
1 comment

The `statement seems to have no effect` warning usually means you've written something that is syntactically valid but doesn't do anything.

For the Service class, you should be able to import it from the webdriver module. Here is a quick example

from selenium import webdriver
from selenium.webdriver.chrome.service import Service

# Define the WebDriver service
service = Service(executable_path='/path/to/chromedriver')

# Pass the service to the WebDriver instance
driver = webdriver.Chrome(service=service)

# Now you can get a webpage as usual
driver.get('https://www.google.com')

# Quit the driver session
driver.quit()
0

Please sign in to leave a comment.