Python Forum
Python Obstacles | Kapap | Wiki Scraped Content [Column Nulling]
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Obstacles | Kapap | Wiki Scraped Content [Column Nulling]
#3
Solved!

Thank you to ndc85430 who linked me to PyMySQL on my other thread: Krav Maga: https://python-forum.io/thread-35939-pos...#pid151485

It worked great for sending the MariaDB CLI Command directly through Python! SQL Alchemy was not the best solution it proved!

I entered values into row 1, 2 and 3 as Alpha!

[Image: CURRENT-2022-01-02-19-56-50.png]
whats my screen size

Here is the working Python Script: Kapap


# Finalized on Python-Forum.io
# Disabled American Constitutional Pre-Law Student: BrandonKastning
# Date: 01/02/2021
# Script: kapap_WTPO_AK.py
# Purpose: Building Block for Python 3.9.9 + MariaDB 10.4.22
# Thread URL with Sources of Learning (Cited on Board)
# Thread URL : https://python-forum.io/thread-35958-post-151561.html
# Kapap
# DB: Eggnest
# Table: WTPO_Dirty_Wiki_Counties_AK
# Purpose: Null All Entries (Rows) within a Column using Python rather than MariaDB CLI

import pymysql.cursors

# Connect to the database
connection = pymysql.connect(host='localhost',
                             user='brandon',
                             password='password',
                             database='Eggnest',
                             cursorclass=pymysql.cursors.DictCursor)

with connection:
    with connection.cursor() as cursor:
        sql = "UPDATE WTPO_Dirty_Wiki_Counties_AK SET american_county_name = NULL;"
        cursor.execute(sql)
brandon@FireDragon:~/Python/05_Kapap$ python3 kapap_WTPO_AK.py
Solution Worked:

[Image: SOLUTION-2022-01-02-20-06-43.png]

Thank you everyone for this forum!

Best Regards,

Brandon Kastning
“And one of the elders saith unto me, Weep not: behold, the Lion of the tribe of Juda, the Root of David, hath prevailed to open the book,...” - Revelation 5:5 (KJV)

“And oppress not the widow, nor the fatherless, the stranger, nor the poor; and ...” - Zechariah 7:10 (KJV)

#LetHISPeopleGo

Reply


Messages In This Thread
RE: Python Obstacles | Kapap | Wiki Scraped Content [Column Nulling] - by BrandonKastning - Jan-03-2022, 04:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Weird characters scraped samuelbachorik 3 968 Oct-29-2023, 02:36 PM
Last Post: DeaD_EyE
  Web scraper not populating .txt with scraped data BlackHeart 5 1,556 Apr-03-2023, 05:12 PM
Last Post: snippsat
  Retrieve website content using Python? Vadanane 1 1,302 Jan-16-2023, 09:55 AM
Last Post: Axel_Erfurt
Question Python Obstacles | Jeet-Kune-Do | BS4 (Tags > MariaDB) [URL/Local HTML] BrandonKastning 0 1,439 Feb-08-2022, 08:55 PM
Last Post: BrandonKastning
  Python Obstacles | Krav Maga | Wiki Scraped Content [Column Copy] BrandonKastning 4 2,274 Jan-03-2022, 06:59 AM
Last Post: BrandonKastning
Lightbulb Python Obstacles | Kung-Fu | Full File HTML Document Scrape and Store it in MariaDB BrandonKastning 5 2,968 Dec-29-2021, 02:26 AM
Last Post: BrandonKastning
  Python Obstacles | American Kenpo | Wiki Scrape URL/Table and Store it in MariaDB BrandonKastning 6 2,903 Dec-29-2021, 12:38 AM
Last Post: BrandonKastning
  Python Obstacles | Karate | HTML/Scrape Specific Tag and Store it in MariaDB BrandonKastning 8 3,243 Nov-22-2021, 01:38 AM
Last Post: BrandonKastning
  Python Web Scraping can not getting all HTML content yqqwe123 0 1,664 Aug-02-2021, 08:56 AM
Last Post: yqqwe123
  to scrape wiki-page: getting back the results - can i use pandas also apollo 2 2,705 Feb-09-2021, 03:57 PM
Last Post: apollo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020