Prepare undetectedchrome
prepare_undetectedchrome ¶
Download chromedriver and apply undetected-chromedriver patch to be called from other languages like VBA return location via INI-file
executeMain(params: ParamsClass) -> None ¶
main routine to download/initialize CloakBrowser and return informationv ia INI-fiel to caller
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params | parameter dataclass filled via CLI | required |
Source code in src\utils_msoffice\prepare_undetectedchrome.py
def executeMain(params: ParamsClass) -> None:
"""
main routine to download/initialize CloakBrowser and return informationv ia INI-fiel to caller
Args:
params (): parameter dataclass filled via CLI
"""
# determine ini file for parameters calling cloakbrowser externally
if params.params_inifile is None:
params.params_inifile = os.path.join(tempfile.gettempdir(), "undetectedchrome.ini")
patcher = Patcher()
patcher.auto()
# determine content of ini file
config = configparser.ConfigParser()
config.add_section("undetectedchrome")
config["undetectedchrome"]["binary_path"] = patcher.executable_path
# write back ini file
with open(params.params_inifile, 'w') as configfile:
config.write(configfile)
executeStandaloneTest() -> None ¶
executeVBAcallee() -> None ¶
callee from VBA (or other language via CLI)