используя следующий код:
Код: Выделить всё
import os, sys
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
import pyautogui
import time
from bs4 import BeautifulSoup
path = os.path.abspath(os.path.dirname(sys.argv[0]))
fnExtension = os.path.join(path, "EmailHunter.crx")
WAIT = 2
print(f"Checking Browser driver...")
options = Options()
options.add_argument("start-maximized")
options.add_argument('--log-level=3')
options.add_extension(fnExtension)
options.add_experimental_option("prefs", {"profile.default_content_setting_values.notifications": 1})
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('excludeSwitches', ['enable-logging'])
options.add_experimental_option('useAutomationExtension', False)
options.add_argument('--disable-blink-features=AutomationControlled')
srv=Service()
driver = webdriver.Chrome (service=srv, options=options)
waitWD = WebDriverWait (driver, 10)
link = f"https://www.orf.at"
driver.get (link)
# driver.get("chrome://extensions/?id=mbindhfolmpijhodmgkloeeppmkhpmhc")
# driver.execute_script("return document.querySelector('extensions-manager').shadowRoot.querySelector('#viewManager > extensions-detail-view.active').shadowRoot.querySelector('div#container.page-container > div.page-content > div#options-section extensions-toggle-row#allow-incognito').shadowRoot.querySelector('label#label input').click()");
fnExtensionIcon = os.path.join(path, "IconExtension.png")
img_location = pyautogui.locateOnScreen(fnExtensionIcon, confidence=0.5)
image_location_point = pyautogui.center(img_location)
x, y = image_location_point
pyautogui.click(x, y)
time.sleep(2)
fnExtensionIcon = os.path.join(path, "IconPin2.png")
img_location = pyautogui.locateOnScreen(fnExtensionIcon, confidence=0.5)
image_location_point = pyautogui.center(img_location)
x, y = image_location_point
pyautogui.click(x, y)
time.sleep(2)
fnExtensionIcon = os.path.join(path, "IconPin3.png")
img_location = pyautogui.locateOnScreen(fnExtensionIcon, confidence=0.5)
image_location_point = pyautogui.center(img_location)
x, y = image_location_point
pyautogui.click(x, y)
time.sleep(WAIT)
soup = BeautifulSoup (driver.page_source, 'lxml')
res = soup.find("a", {"id": "btnExport"})
print(res)
input("Press2!")
[img]https://i.sstatic.net /19mG07J3.png[/img]


Но я не могу найти ссылку, по которой можно найти результаты:
blob:chrome-extension://mbindhfolmpijhodmgkloeeppmkhpmhc/4cef8c7f-204b-43b8-98ab-fda54b02ec3c
Я получаю только его вывод:
Код: Выделить всё
(seleniumALL) C:\DEVNEU\Fiverr2024\ORDER\robalf\TRYuseExtension>python test.py
Checking Browser driver...
None
Подробнее здесь: https://stackoverflow.com/questions/793 ... -extension
Мобильная версия