Add initial project files including .gitignore, VSCode settings, and user profile creation script for Chrome
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
perfiles_chrome
|
||||||
Vendored
+22
@@ -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"
|
||||||
|
}
|
||||||
@@ -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)
|
||||||
Reference in New Issue
Block a user