def __init__( IndentationError: unexpected indent, browser automate selenium OOP
Question:
I am having this indentation error in the def init. My goal is to configure the browser for a web scraping app.
this is the code for the config part:
CHROMEDRIVER_PATH = r"C:UsersNarsildevseleniumDriverschromedriver.exe"
class Browser_bot(webdriver.Chrome):
"""
Class to manage and configure web browser
"""
def __init__(
self, driver_path=CHROMEDRIVER_PATH, headless=True, time_out=0,
proxy_server="", proxy_port="", proxy_user="", proxy_pass="",
chrome_folder="", user_agent=True, capabilities=False):
"""
Constructor of the class
"""
Answers:
There is a space before your first coment (Line 4)
I am having this indentation error in the def init. My goal is to configure the browser for a web scraping app.
this is the code for the config part:
CHROMEDRIVER_PATH = r"C:UsersNarsildevseleniumDriverschromedriver.exe"
class Browser_bot(webdriver.Chrome):
"""
Class to manage and configure web browser
"""
def __init__(
self, driver_path=CHROMEDRIVER_PATH, headless=True, time_out=0,
proxy_server="", proxy_port="", proxy_user="", proxy_pass="",
chrome_folder="", user_agent=True, capabilities=False):
"""
Constructor of the class
"""
There is a space before your first coment (Line 4)