Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ozcanyarimdunya authored Dec 25, 2018
1 parent 5f6f301 commit ac75022
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions [Proje - 27] records, requests, bs4 ile realpython/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class RealPython:
base_url = "https://realpython.com"

def __init__(self):
"""
Initialise method RealPython class
:return: None
"""
# check if table already exists, if yes then delete it
self.db.query(
"""DROP TABLE IF EXISTS TUTORIAL"""
Expand Down Expand Up @@ -79,7 +83,7 @@ def scrap(self):
def print(self):
"""
Select all data from database then print it row by row
:return:
:return: None
"""
all_data = self.db.query(
"""SELECT * FROM TUTORIAL"""
Expand All @@ -102,13 +106,13 @@ def print(self):


# create an instance of RealPython class
r = RealPython()
rp = RealPython()

# run scrap method
r.scrap()
rp.scrap()

# print method
r.print()
rp.print()

# Output
"""
Expand Down

0 comments on commit ac75022

Please sign in to comment.