Задать вопрос
@aqau123

Почему выводятся логи при старте селениума?

Почему выводятся логи при старте селениума?
DevTools listening on ws://127.0.0.1:60106/devtools/browser/ccd3745f-fa67-48b1-98ea-e20796de873b
[1231/150821.686:INFO:CONSOLE(263)] "NinjaTracker.init()", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (263)
[1231/150821.688:INFO:CONSOLE(119)] "_loadScript() https://ninja.data.olxcdn.com/ninja-cee.js", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (119)
[1231/150821.689:INFO:CONSOLE(305)] "NinjaTracker.onStartupPush()", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (305)
[1231/150822.647:INFO:CONSOLE(709)] "NinjaTracker.registerEvent() #postNewAdLink", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (709)
[1231/150822.648:INFO:CONSOLE(532)] "NinjaTracker.unregisterAsyncPayload()", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (532)
[1231/150822.648:INFO:CONSOLE(130)] "_unregisterEvents() true", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (130)
[1231/150822.649:INFO:CONSOLE(709)] "NinjaTracker.registerEvent() .maincategories-list a", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (709)
[1231/150822.650:INFO:CONSOLE(709)] "NinjaTracker.registerEvent() .subcategories-list > ul a", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (709)
[1231/150822.650:INFO:CONSOLE(709)] "NinjaTracker.registerEvent() .subcategories-title a", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (709)
[1231/150822.650:INFO:CONSOLE(709)] "NinjaTracker.registerEvent() #cityField", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (709)
[1231/150822.651:INFO:CONSOLE(709)] "NinjaTracker.registerEvent() #cityField", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (709)
[1231/150822.651:INFO:CONSOLE(709)] "NinjaTracker.registerEvent() #cityField", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (709)
[1231/150822.652:INFO:CONSOLE(709)] "NinjaTracker.registerEvent() #submit-searchmain", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (709)
[1231/150822.652:INFO:CONSOLE(709)] "NinjaTracker.registerEvent() .observe-link", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (709)
[1231/150822.653:INFO:CONSOLE(709)] "NinjaTracker.registerEvent() .observe-link", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (709)
[1231/150822.813:INFO:CONSOLE(437)] "NinjaTracker.push() [object Object]", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (437)
[1231/150822.840:INFO:CONSOLE(473)] "NinjaTracker.delayPush() [object Object]", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (473)
[1231/150822.923:INFO:CONSOLE(437)] "NinjaTracker.push() [object Object]", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (437)
[1231/150823.491:INFO:CONSOLE(437)] "NinjaTracker.push() [object Object]", source: https://static.olx.bg/static/olxbg/naspersclassifieds-regional/olxeu-atlas-web/static/js/tracking/ninja.js?v=22a14426 (437)

Вроде все options прописаны, и раньше такого не было.
class SeleniumDriver(object):
    def __init__(self, headers: List[dict], headless: bool) -> None:
        self.driver: webdriver.Chrome = None

        self.options = webdriver.ChromeOptions()
        if headless: self.options.add_argument('--headless')
        self.options.add_argument('--ignore-certificate-errors')
        self.options.add_argument("--start-maximized")
        self.options.add_argument('--ignore-ssl-errors')
        self.options.add_argument('--ignore-gpu-blacklist')
        self.options.add_argument('--use-gl')
        self.options.add_argument('--disable-web-security')
        self.options.add_argument('--disable-gpu')
        self.options.add_argument('--user-agent={}'.format(headers))
        self.options.add_experimental_option("excludeSwitches", ['enable-logging'])
        self.options.add_experimental_option("excludeSwitches", ['enable-automation'])

    def initDriver(self, executablePath: str) -> None:
        self.driver = webdriver.Chrome(service=Service(executable_path=executablePath), options=self.options)

async def main() -> None:
    s = seleniumdriver.SeleniumDriver(
        headers="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1623.0 Safari/537.36",
        headless=True
    )

    s.initDriver(executablePath=config.CHROMEDRIVER)

    s.driver.get('https://www.olx.bg/')
  • Вопрос задан
  • 75 просмотров
Подписаться 1 Простой 3 комментария
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы