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

Source Table:

[Image: SOURCE-2022-01-02-22-12-32.png]
download avatar instagram online

Current Destination Table:

[Image: kapap-CURRENT-2022-01-02-22-11-53.png]

Solution:

[Image: SOLUTION-2022-01-02-22-34-16.png]
instagram photo full size download

Python Code:

# Finalized on Python-Forum.io
# Disabled American Constitutional Pre-Law Student: BrandonKastning
# Date: 01/02/2021
# Script: kravmaga_WTPO_IA.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-35939-post-151485.html

# Krav Maga
# DB: Eggnest
# Source Table: WTPO_Dirty_Wiki_Counties_IA
# Destination Table: WTPO_Dirty_Wiki_Counties_IA_TWO
# Purpose: Populate column "american_county_name" from Source Table to Destination Table

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 = "INSERT INTO `WTPO_Dirty_Wiki_Counties_IA_TWO` (`american_county_name`) SELECT `american_county_name` FROM `WTPO_Dirty_Wiki_Counties_IA`;"
        cursor.execute(sql)
It works! However it doesn't start on row 1; it INSERTED new rows on top of all the nulled values within the 99 row range. Then added from 100+

I wish I knew how to "if row 1 = value = NULL then replace" *or something* !

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 | Krav Maga | Wiki Scraped Content [Column Copy] - by BrandonKastning - Jan-03-2022, 06:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting content from a website using Python? SandraYokum 4 2,024 Jun-18-2024, 07:57 AM
Last Post: Larz60+
  Weird characters scraped samuelbachorik 3 2,107 Oct-29-2023, 02:36 PM
Last Post: DeaD_EyE
  Web scraper not populating .txt with scraped data BlackHeart 5 2,843 Apr-03-2023, 05:12 PM
Last Post: snippsat
  Retrieve website content using Python? Vadanane 1 2,199 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,904 Feb-08-2022, 08:55 PM
Last Post: BrandonKastning
  Python Obstacles | Kapap | Wiki Scraped Content [Column Nulling] BrandonKastning 2 2,600 Jan-03-2022, 04:26 AM
Last Post: BrandonKastning
Lightbulb Python Obstacles | Kung-Fu | Full File HTML Document Scrape and Store it in MariaDB BrandonKastning 5 4,160 Dec-29-2021, 02:26 AM
Last Post: BrandonKastning
  Python Obstacles | American Kenpo | Wiki Scrape URL/Table and Store it in MariaDB BrandonKastning 6 4,146 Dec-29-2021, 12:38 AM
Last Post: BrandonKastning
  Python Obstacles | Karate | HTML/Scrape Specific Tag and Store it in MariaDB BrandonKastning 8 4,667 Nov-22-2021, 01:38 AM
Last Post: BrandonKastning
  Python Web Scraping can not getting all HTML content yqqwe123 0 2,277 Aug-02-2021, 08:56 AM
Last Post: yqqwe123

Forum Jump:

User Panel Messages

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