|
|
@ -107,6 +107,7 @@ def read_file(filePath, createLog, logFile): |
|
|
|
html = codecs.open(filePath.strip('\n'), encoding='utf8') |
|
|
|
soup = BeautifulSoup(html, "html.parser") |
|
|
|
html.close() |
|
|
|
time.sleep(0.01) # making sure the file is closed before returning soup object |
|
|
|
return soup |
|
|
|
except: |
|
|
|
|
|
|
@ -114,6 +115,7 @@ def read_file(filePath, createLog, logFile): |
|
|
|
html = open(filePath.strip('\n')) |
|
|
|
soup = BeautifulSoup(html, "html.parser") |
|
|
|
html.close() |
|
|
|
time.sleep(0.01) # making sure the file is closed before returning soup object |
|
|
|
return soup |
|
|
|
except: |
|
|
|
|
|
|
@ -271,7 +273,7 @@ def persist_record(url, rec, cur, con, createLog, logFile, listingFile, descript |
|
|
|
def move_file(filePath, createLog, logFile): |
|
|
|
|
|
|
|
source = filePath |
|
|
|
destination = filePath.replace(os.path.basename(filePath), "") + r'Read/' + os.path.basename(filePath) |
|
|
|
destination = filePath.replace(os.path.basename(filePath), "") + 'Read\\' + os.path.basename(filePath) |
|
|
|
|
|
|
|
try: |
|
|
|
shutil.move(source, destination, shutil.copy2) |
|
|
@ -307,7 +309,7 @@ def new_parse(marketPlace, url, createLog): |
|
|
|
# Creating the tables (The database should be created manually) |
|
|
|
create_database(cur, con) |
|
|
|
|
|
|
|
mainDir = os.path.join(config.get('Project', 'shared_folder'), "MarketPlaces/" + marketPlace + "/HTML_Pages") |
|
|
|
mainDir = os.path.join(config.get('Project', 'shared_folder'), "MarketPlaces\\" + marketPlace + "\\HTML_Pages") |
|
|
|
|
|
|
|
# Creating the log file for each Forum |
|
|
|
if createLog: |
|
|
|