-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web): refactor the web operator (#772)
Because - we want to make scrape page to pages - there are merged code not updated from the review of #753 This commit - make scrape page to pages - modify the code based on the review note - web operator QA results are in `Test Result` thread in the linear ticket - migration QA result is in `Migration QA` thread in the linear ticket
- Loading branch information
1 parent
8d842a6
commit ae4e3c2
Showing
14 changed files
with
542 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,54 @@ | ||
|
||
|
||
## Example Recipes | ||
|
||
```yaml | ||
version: v1beta | ||
|
||
variable: | ||
url: | ||
title: url | ||
title: URL | ||
instill-format: string | ||
|
||
component: | ||
crawler: | ||
type: web | ||
input: | ||
root-url: ${variable.url} | ||
url: ${variable.url} | ||
allowed-domains: | ||
max-k: 10 | ||
timeout: 0 | ||
max-k: 30 | ||
timeout: 1000 | ||
max-depth: 0 | ||
condition: | ||
task: TASK_CRAWL_SITE | ||
|
||
json-filter: | ||
type: json | ||
input: | ||
json-value: ${crawler.output.pages} | ||
jq-filter: .[] | ."link" | ||
condition: | ||
task: TASK_JQ | ||
|
||
scraper: | ||
type: web | ||
input: | ||
url: ${crawler.output.pages[0].link} | ||
urls: ${json-filter.output.results} | ||
scrape-method: http | ||
include-html: false | ||
only-main-content: true | ||
remove-tags: | ||
only-include-tags: | ||
timeout: 1000 | ||
timeout: 0 | ||
condition: | ||
task: TASK_SCRAPE_PAGE | ||
task: TASK_SCRAPE_PAGES | ||
|
||
output: | ||
markdown: | ||
title: Markdown | ||
value: ${scraper.output.markdown} | ||
pages: | ||
title: Pages | ||
value: ${crawler.output.pages} | ||
links: | ||
title: links | ||
value: ${scraper.output.links-on-page} | ||
title: Links | ||
value: ${json-filter.output.results} | ||
scraper-pages: | ||
title: Scraper Pages | ||
value: ${scraper.output.pages} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.