Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

If the "Open Browser" or "Connect to an open browser" action fails, it is recommended to do the following:

  • Check if there are no unnecessary (hung) workflows of the selected browser in Task Manager and close them. (All browser openings in robots MUST end with closing the browser in order to avoid workflows hanging in memory, which can then interfere with the work of the next instances).
  • Update the driver version, more details: Instructions on how to add a browser driver.

Problems that are only possible with the "Open Browser" action in Chrome or Yandex Browser:

If two instances of Chrome browser are launched simultaneously (or attempt to launch Chrome (Yandex Browser) while Yandex Browser (Chrome) is running simultaneously) using the same directory (folder) for storing profile data (user-data-dir), it may block one of them from working. To prevent conflict, it is recommended to create separate directories (folders) for each browser instance. Options for solving this problem:

  • Copying an existing profile folder:
    1. Create a separate folder anywhere to store the settings of the robot-controlled browser.
    2. Copy the contents from the: for Chrome folder into the folder you created:
      • "
  1. Выбрать действие «Открыть браузер», из группы действий «Браузер» .

    Image Removed

  2. Выбрать «Chrome» в параметрах действия в строке «Браузер».

    Image Removed

  3. Указать описывающий список свойств браузера и их значений, которые будут установлены при запуске, в строке «Свойства», в формате JSON.
  4. C:\\Users\\<User>\\AppData\\Local\\Google\\Chrome\\User Data - путь к профилю браузера.
  5. profile-directory - если в браузере существует несколько профилей, можно указать нужный профиль с которого будет произведен запуск робота (по умолчанию указывается Default).
    Image Removed
    Блок кода
    titleШаблон
    {"acceptInsecureCerts":true,"browserName":"chrome","goog:loggingPrefs": {"browser": "ALL"},"timeouts":
    
     {"implicit":0,"pageLoad": 30000,"script": 30000},"unhandledPromptBehavior":"dismiss", "goog:chromeOptions": {"args": [ "disable-popup-blocking","disable-notifications","no-sandbox","disable-infobars","disable-extensions","disable-gpu","start-maximized","user-data-dir=C:\\Users\\User>\\AppData\\Local\\Google\\Chrome\\User Data","profile-directory=Default"],"extensions":[]}}

    Пример заполнения полей:

    Image Removed

  6. Запустить робота. Браузер откроется с профилем.

Особые условия использования

Невозможность запустить браузер без профиля

В случае если не удаётся выполнить действие "Открыть браузер" рекомендуется сделать следующее:

  • Проверить нет ли лишних (зависших) процессов Chrome. (Все открытия браузера в роботах ОБЯЗАТЕЛЬНО должны оканчиваться закрытием браузера, дабы избежать зависших в памяти процессов, которые потом могут и мешать работе следующих экземпляров).
  • Обновить версию драйверов, подробнее: Инструкция по добавлению драйвера для браузера.
  • Если одновременно запущены два экземпляра браузера Chrome (или производится попытка запуска Chrome (Yandex Браузера), при одновременно работающем Yandex Браузере (Chrome)), использующие одну и ту же директорию для хранения данных профиля (user-data-dir), это может блокировать работу одного из них. Для предотвращения конфликта рекомендуется создавать отдельные директории для каждого экземпляра браузера. Аналогичная проблема возникает при использовании Yandex Браузера, поскольку он и Chrome основаны на Chromium. Для решения этой проблемы:
    Копирование существующей директории профиля:
  • Создайте новую директорию для хранения настроек управляемого браузера.
  • Скопируйте содержимое стандартной директории настроек Chrome:
      • C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data
    . Это позволит сохранить все текущие настройки и профили.
      • ";
      • for Yandex Браузер: "C:\Users\USERNAME\AppData\Local\Yandex\YandexBrowser\User Data".
        AppData folder is hidden. To see it, turn on the hidden folders display. All current settings and profiles will be copied.
    1. Copy the path to the new folder, and use it in the "Properties" parameter from the "Open Browser" action, more: Launching with a profile for all browsers.
  • Using an empty folder (Chrome and Yandex Browser):
    1. Create a separate folder anywhere to store the settings of the robot-controlled browser.
    2. Copy the path to the new folder, and use it in the "Properties" parameter from the "Open Browser" action, more: Launching with a profile for all browsers.
    3. On first launch, chrome will create all the default data. The work will be performed 
  • Использование пустой директории:
    1. Создайте новую пустую директорию для хранения настроек. При первом запуске Chrome автоматически создаст в ней данные профиля по умолчанию.
  • Настройка через ярлык:
  • Скопируйте ярлык Chrome и переименуйте его для отличия от основного экземпляра.
  • В свойствах ярлыка укажите в поле "Объект" параметр --user-data-dir, определив отдельную директорию для хранения данных. Пример: "C:\Program Files\Google\Chrome\Application\chrome.exe" --user-data-dir="C:\DISK D\tmp\SeparateChromeUserDir".
  • Запустите экземпляр браузера.
  • Настройте его при необходимости.