Skip to content

fix(crawler): create raw directory before writing metadata file#60

Open
D4R102004 wants to merge 1 commit into
mainfrom
fix/issue-59-lobsters-missing-directory
Open

fix(crawler): create raw directory before writing metadata file#60
D4R102004 wants to merge 1 commit into
mainfrom
fix/issue-59-lobsters-missing-directory

Conversation

@D4R102004

Copy link
Copy Markdown
Owner

What

Add os.makedirs() before opening _metadata.txt in run_all_crawlers().

Why

When a spider's output directory does not exist (e.g. data/raw/lobsters/), the metadata write fails with FileNotFoundError. This caused Lobsters to report 0 articles even when the crawl succeeded.

Tests

21/21 crawler tests passed.

Closes #59

Add os.makedirs() before opening _metadata.txt to prevent
FileNotFoundError when the spider output directory does not exist.

Closes #59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: lobsters crawler fails when data/raw/lobsters/ directory does not exist

1 participant