Optimization:
clustered error files into a folder
This commit is contained in:
parent
7726650eaa
commit
35f5f2ac5e
@ -155,6 +155,8 @@ def process_article(title, article_url):
|
|||||||
# Extract volume
|
# Extract volume
|
||||||
volume_match = re.search(r'Vol\. (\d+) \((\d+)\)', article_text)
|
volume_match = re.search(r'Vol\. (\d+) \((\d+)\)', article_text)
|
||||||
volume = str(volume_match.group(1)) if volume_match else None
|
volume = str(volume_match.group(1)) if volume_match else None
|
||||||
|
if not volume:
|
||||||
|
volume = str(volume_match.group(2)) if volume_match else None
|
||||||
|
|
||||||
# Extract pp
|
# Extract pp
|
||||||
pp_match = re.search(r'pp\. (\d+-\d+)', article_text)
|
pp_match = re.search(r'pp\. (\d+-\d+)', article_text)
|
||||||
@ -374,15 +376,15 @@ if len(authorData) > 0:
|
|||||||
|
|
||||||
# Save error record
|
# Save error record
|
||||||
if len(totallyFailedData) > 0:
|
if len(totallyFailedData) > 0:
|
||||||
ejde_save.save_data(failedData, "", "Failed_article_record.json")
|
ejde_save.save_data(failedData, "Error", "Failed_article_record.json")
|
||||||
print("Total failed processing paper:", len(totallyFailedData))
|
print("Total failed processing paper:", len(totallyFailedData))
|
||||||
|
|
||||||
if len(failedVolData) > 0:
|
if len(failedVolData) > 0:
|
||||||
ejde_save.save_data(failedVolData, "", "Failed_volume_record.json")
|
ejde_save.save_data(failedVolData, "Error", "Failed_volume_record.json")
|
||||||
print("Total failed fetching volume:", len(failedVolData))
|
print("Total failed fetching volume:", len(failedVolData))
|
||||||
|
|
||||||
if len(failedFormatData) > 0:
|
if len(failedFormatData) > 0:
|
||||||
ejde_save.save_data(failedFormatData, "", "Failed_format_record.json")
|
ejde_save.save_data(failedFormatData, "Error", "Failed_format_record.json")
|
||||||
print("Total failed searching article:", len(failedFormatData))
|
print("Total failed searching article:", len(failedFormatData))
|
||||||
|
|
||||||
# Total running time
|
# Total running time
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user