# Create project for WebGUI tutorial

dev-linux
Ivan Maslov 4 years ago
parent fbc3f82dbe
commit a97e0f0e17

2
.gitignore vendored

@ -1,3 +1,5 @@
# Игнорируем новые файлы из Google Portable
/**/Resources/GoogleChromePortable
#Игнорируем все папки с названием __pycache__ #Игнорируем все папки с названием __pycache__
/**/__pycache__/** /**/__pycache__/**
#Игнорируем папки распакованного блокнота #Игнорируем папки распакованного блокнота

@ -1,3 +1,3 @@
cd %~dp0..\OpenRPA\Sources cd %~dp0..\..\..\Sources
..\Resources\WPy64-3720\python-3.7.2.amd64\python.exe "..\..\OpenRPA Habr\2. MonitoringModeProgrammer_Run_64.py" ..\Resources\WPy64-3720\python-3.7.2.amd64\python.exe "..\Wiki\RUS_Tutorial\DesktopGUI_Habr\2. MonitoringModeProgrammer_Run_64.py"
pause >nul pause >nul

@ -0,0 +1,3 @@
cd %~dp0..\..\..\Sources
..\Resources\WPy64-3720\python-3.7.2.amd64\python.exe "..\Wiki\RUS_Tutorial\WebGUI_Habr\3. MonitoringCIAN_Run_64.py"
pause >nul

@ -0,0 +1,29 @@
# Init Chrome web driver with extensions (if applicable)
# Import section
from selenium import webdriver
##########################
# Init the Chrome web driver
###########################
gChromeExeFullPath = r'..\Resources\GoogleChromePortable\GoogleChromePortable.exe'
gExtensionFullPathList = []
gWebDriverFullPath = r'..\Resources\SeleniumWebDrivers\Chrome\chromedriver_win32 v84.0.4147.30\chromedriver.exe'
def WebDriverInit(inWebDriverFullPath, inChromeExeFullPath, inExtensionFullPathList):
# Set full path to exe of the chrome
lWebDriverChromeOptionsInstance = webdriver.ChromeOptions()
lWebDriverChromeOptionsInstance.binary_location = inChromeExeFullPath
# Add extensions
for lExtensionItemFullPath in inExtensionFullPathList:
lWebDriverChromeOptionsInstance.add_extension (lExtensionItemFullPath)
# Run chrome instance
lWebDriverInstance = None
if inWebDriverFullPath:
# Run with specified web driver path
lWebDriverInstance = webdriver.Chrome(executable_path = inWebDriverFullPath, chrome_options=lWebDriverChromeOptionsInstance)
else:
lWebDriverInstance = webdriver.Chrome(chrome_options = lWebDriverChromeOptionsInstance)
# Return the result
return lWebDriverInstance
# Инициализировать Google Chrome with selenium web driver
lWebDriver = WebDriverInit(inWebDriverFullPath = gWebDriverFullPath, inChromeExeFullPath = gChromeExeFullPath, inExtensionFullPathList = gExtensionFullPathList)
Loading…
Cancel
Save