I am having this attributeError AttributeError: 'Web_scraping' object has no attribute '_Web_scraping__headless'
import time
import os
from scraping.browser_manager import constants as const
from selenium import webdriver
from selenium.webdriver.common.by import By
from scraping.browser_manager.automate_browser import Browser_bot
class Web_scraping():
def __init__(self):
# self.scraper instance
self.scraper = Browser_bot(headless=self.__headless)
def accept_cookies(self):
cookies = self.find_element(By.CSS_SELECTOR,
'.sui-TcfFirstLayer-buttons > button:nth-child(2)'
)
time.sleep(5)
cookies.click()
this is the run.py function
from scraping.scraper import Web_scraping
try:
with Web_scraping() as bot:
bot.accept_cookies()