Spaces:
Running
Running
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.remote.webdriver import WebDriver | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from webdriver_manager.chrome import ChromeDriverManager | |
from selenium.webdriver.chrome.service import Service | |
from bs4 import BeautifulSoup | |
import time, threading | |
class SeleniumScraper: | |
def __init__(self): | |
options = Options() | |
options.add_argument("--headless") | |
options.add_argument('--no-sandbox') | |
options.add_argument("--no-quit") | |
options.add_argument('--disable-extensions') | |
options.add_argument('--disable-gpu') | |
options.add_argument('--disable-dev-shm-usage') | |
options.set_capability('goog:loggingPrefs', {'performance': 'ALL'}) | |
self.__driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options) | |
def driver(self): | |
return self.__driver | |