diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9fa7a11 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +perfiles_chrome diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4ab2e3c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,22 @@ +{ + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#fbed80", + "activityBar.background": "#fbed80", + "activityBar.foreground": "#15202b", + "activityBar.inactiveForeground": "#15202b99", + "activityBarBadge.background": "#06b9a5", + "activityBarBadge.foreground": "#15202b", + "commandCenter.border": "#15202b99", + "sash.hoverBorder": "#fbed80", + "statusBar.background": "#f9e64f", + "statusBar.foreground": "#15202b", + "statusBarItem.hoverBackground": "#f7df1e", + "statusBarItem.remoteBackground": "#f9e64f", + "statusBarItem.remoteForeground": "#15202b", + "titleBar.activeBackground": "#f9e64f", + "titleBar.activeForeground": "#15202b", + "titleBar.inactiveBackground": "#f9e64f99", + "titleBar.inactiveForeground": "#15202b99" + }, + "peacock.color": "#f9e64f" +} \ No newline at end of file diff --git a/crear_carpeta_chrome.py b/crear_carpeta_chrome.py new file mode 100644 index 0000000..181ac60 --- /dev/null +++ b/crear_carpeta_chrome.py @@ -0,0 +1,34 @@ +import os +import subprocess + +def crear_carpeta_usuario(ruta_chrome, ruta_carpeta_usuario): + # Asegúrate de que la ruta proporcionada para la carpeta del usuario existe + if not os.path.exists(ruta_carpeta_usuario): + os.makedirs(ruta_carpeta_usuario) + + # Comando para iniciar Chrome con la carpeta de usuario personalizada + comando = [ + ruta_chrome, # Ruta del ejecutable de Chrome + f"--user-data-dir={ruta_carpeta_usuario}" # Carpeta de usuario personalizada + ] + + try: + # Ejecuta Chrome con el perfil de usuario personalizado + subprocess.run(comando, check=True) + print(f"Chrome iniciado con la carpeta de usuario: {ruta_carpeta_usuario}") + except FileNotFoundError: + print("El ejecutable de Chrome no se encontró. Verifica la ruta proporcionada.") + except subprocess.CalledProcessError as e: + print(f"Hubo un error al iniciar Chrome: {e}") + +# Ejemplo de uso +if __name__ == "__main__": + # ruta_chrome = input("Introduce la ruta completa al ejecutable de Chrome: ") + # ruta_carpeta_usuario = input("Introduce la ruta donde deseas crear la carpeta de usuario: ") + nombre_usuario = "usuario1" + + + ruta_chrome = r"C:\Program Files\Google\Chrome\Application\chrome.exe" + ruta_carpeta_usuario = rf"E:\Proyects\Herramientas_para_scrapping\perfiles_chrome\{nombre_usuario}" + + crear_carpeta_usuario(ruta_chrome, ruta_carpeta_usuario)