PythonOOP icon indicating copy to clipboard operation
PythonOOP copied to clipboard

I was forced to come raise an issue here so as to reach out to you

Open femiir opened this issue 4 years ago • 0 comments

hey Jim I am following your tutorial on selenium I am using Facebook to test and I am using a MacBook I installed my chrome driver using brew

I run into my first issue which is alert and I want to disable alerts and have no idea how to add it to my chrome since it opens on its own without declaring a driver path please help

import facebook.constants as const
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time

class FacebookBot(webdriver.Chrome):
    """a class to control and automate a facebook bot for srappping"""
    def __init__(self, teardown=False):
        self.teardown = teardown
        super(FacebookBot, self).__init__()
       
        
        self.implicitly_wait(20)

    def __exit__(self, *args) -> None:
        if self.teardown:
            self.quit()
            return super().__exit__(*args)
         

    def facebook_homepage(self):
        """navigating the facebook scrapper bot to the facebook home page."""
        self.get(const.BASE_URL)```

femiir avatar Sep 07 '21 19:09 femiir