Compare commits
2 Commits
a68d4895cd
...
168a2a9984
Author | SHA1 | Date |
---|---|---|
|
168a2a9984 | |
|
d8ed58b5b2 |
|
@ -2,9 +2,10 @@
|
|||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
</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" />
|
||||
</component>
|
||||
<component name="PyDocumentationSettings">
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.11.2 WSL (Debian): (/home/santi/.virtualenvs/Final/bin/python)" />
|
||||
</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>
|
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.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"],
|
||||
sender_name=config_manager.config["Chat"]["name"],
|
||||
stop_event=stop_event, width=200, bg="lightgreen", refresh_rate=1)
|
||||
|
|
|
@ -33,16 +33,29 @@ class WebScrapingTab(ThreadedTab):
|
|||
self.data_listbox.pack(pady=10)
|
||||
|
||||
def create_database(self):
|
||||
# Connect to MySQL database
|
||||
try:
|
||||
# Conectar sin especificar la base de datos
|
||||
conn = mysql.connector.connect(
|
||||
host="127.0.0.1",
|
||||
user="santipy",
|
||||
password="1234"
|
||||
)
|
||||
cursor = conn.cursor()
|
||||
|
||||
# Crear la base de datos si no existe
|
||||
cursor.execute("CREATE DATABASE IF NOT EXISTS scraping_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci")
|
||||
conn.commit()
|
||||
|
||||
# Conectar a la base de datos
|
||||
conn = mysql.connector.connect(
|
||||
host="127.0.0.1",
|
||||
user="santipy",
|
||||
password="1234",
|
||||
database="scraping_db"
|
||||
)
|
||||
cursor = conn.cursor()
|
||||
|
||||
# Crear la tabla si no existe
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("""
|
||||
CREATE TABLE IF NOT EXISTS scraped_data (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
|
@ -51,7 +64,12 @@ class WebScrapingTab(ThreadedTab):
|
|||
)
|
||||
""")
|
||||
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):
|
||||
|
|
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