Compare commits
2 Commits
a68d4895cd
...
168a2a9984
Author | SHA1 | Date |
---|---|---|
|
168a2a9984 | |
|
d8ed58b5b2 |
|
@ -2,9 +2,10 @@
|
||||||
<module type="PYTHON_MODULE" version="4">
|
<module type="PYTHON_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Python 3.13 (pythonProject)" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3.13 (Final)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PyDocumentationSettings">
|
<component name="PyDocumentationSettings">
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
<component name="Black">
|
<component name="Black">
|
||||||
<option name="sdkName" value="Python 3.11.2 WSL (Debian): (/home/santi/.virtualenvs/Final/bin/python)" />
|
<option name="sdkName" value="Python 3.11.2 WSL (Debian): (/home/santi/.virtualenvs/Final/bin/python)" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (pythonProject)" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13 (Final)" project-jdk-type="Python SDK" />
|
||||||
</project>
|
</project>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -152,7 +152,7 @@ frame_right.rowconfigure(0, weight=3)
|
||||||
frame_right.rowconfigure(1, weight=1)
|
frame_right.rowconfigure(1, weight=1)
|
||||||
frame_right.columnconfigure(0, weight=1)
|
frame_right.columnconfigure(0, weight=1)
|
||||||
|
|
||||||
# Create and place the chat frame and music player tab
|
# Create and place the chat frame and music player tab update
|
||||||
chat_frame = ChatTab(frame_chat, chat_server_url=config_manager.config["Chat"]["server"],
|
chat_frame = ChatTab(frame_chat, chat_server_url=config_manager.config["Chat"]["server"],
|
||||||
sender_name=config_manager.config["Chat"]["name"],
|
sender_name=config_manager.config["Chat"]["name"],
|
||||||
stop_event=stop_event, width=200, bg="lightgreen", refresh_rate=1)
|
stop_event=stop_event, width=200, bg="lightgreen", refresh_rate=1)
|
||||||
|
|
|
@ -33,25 +33,43 @@ class WebScrapingTab(ThreadedTab):
|
||||||
self.data_listbox.pack(pady=10)
|
self.data_listbox.pack(pady=10)
|
||||||
|
|
||||||
def create_database(self):
|
def create_database(self):
|
||||||
# Connect to MySQL database
|
try:
|
||||||
conn = mysql.connector.connect(
|
# Conectar sin especificar la base de datos
|
||||||
host="127.0.0.1 ",
|
conn = mysql.connector.connect(
|
||||||
user="santipy",
|
host="127.0.0.1",
|
||||||
password="1234",
|
user="santipy",
|
||||||
database="scraping_db"
|
password="1234"
|
||||||
)
|
)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
# Crear la tabla si no existe
|
# Crear la base de datos si no existe
|
||||||
cursor.execute("""
|
cursor.execute("CREATE DATABASE IF NOT EXISTS scraping_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci")
|
||||||
CREATE TABLE IF NOT EXISTS scraped_data (
|
conn.commit()
|
||||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
title VARCHAR(255),
|
# Conectar a la base de datos
|
||||||
link TEXT
|
conn = mysql.connector.connect(
|
||||||
)
|
host="127.0.0.1",
|
||||||
""")
|
user="santipy",
|
||||||
conn.commit()
|
password="1234",
|
||||||
return conn
|
database="scraping_db"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Crear la tabla si no existe
|
||||||
|
cursor = conn.cursor()
|
||||||
|
cursor.execute("""
|
||||||
|
CREATE TABLE IF NOT EXISTS scraped_data (
|
||||||
|
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
title VARCHAR(255),
|
||||||
|
link TEXT
|
||||||
|
)
|
||||||
|
""")
|
||||||
|
conn.commit()
|
||||||
|
|
||||||
|
return conn
|
||||||
|
except mysql.connector.Error as err:
|
||||||
|
print(f"Error al conectar o crear la base de datos: {err}")
|
||||||
|
messagebox.showerror("Database Error", f"Error al conectar o crear la base de datos: {err}")
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def save_to_database(self):
|
def save_to_database(self):
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue