DBConnection module¶
-
class
DBConnection.
DBConnection
(options=False)¶ Bases:
object
-
conn
= None¶
-
db_name
= None¶
-
db_type
= None¶
-
get_article_html_from_db
(url)¶ Returns only the HTML of the selected URL if it is in the database
Parameters: url – Returns:
-
is_already_analyzed
(url)¶ Checks if the current URL is in the Articles table
Return type: Boolean Returns: True if the set URL is already in the Articles table of the database
-
queue_article_list
(article_list)¶ Adds each URL in the given article_list to the Queue table of the database
Parameters: article_list – List of article URLs to be inserted into the DB Returns: Void
-
read_article_queue
()¶ Reads database Queue table and returns the whole table as a list
Returns: list of URLs to be downloaded and parsed
-
save_data_to_db
(sc)¶ Saves current article to the connected database
Returns: Void
-
verify_mysql_db
()¶
-
verify_sqlite_db
()¶
-