Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section how to run to the read me, also add a main.py with the running command line #2

Merged
merged 2 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,23 @@ After object embedding this becomes:

## Freeze dependencies
- pipreqs

# How to run
- Set following required parameters in the `class TreeSpider` of [tree.py](./crawldf/spiders/tree.py). Please refer to the example [gipod.py](./crawldf/spiders/gipod.py).
- name
- e.g. name = "gipod"
- allowed_domains
- e.g. allowed_domains = ["private-api.gipod.beta-vlaanderen.be"]
- start_urls
- e.g. start_urls = ["https://private-api.gipod.beta-vlaanderen.be/api/v1/ldes/mobility-hindrances"]
- Under the directory `./crawldf/`, run `scrapy crawl [name]`, e.g.`scrapy crawl gipod`.
or create a [main.py](./crawldf/main.py) under the directory `./crawldf/` with follow content, please modify it accordingly:

```
from scrapy.cmdline import execute
execute(["scrapy","crawl","gipod"])
```

# Output
- `items.rdf` file is generated under the directory `./crawldf/`

2 changes: 2 additions & 0 deletions crawldf/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from scrapy.cmdline import execute
execute(["scrapy","crawl","gipod"])