-
Notifications
You must be signed in to change notification settings - Fork 0
/
socket.yml
80 lines (76 loc) · 2.08 KB
/
socket.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: simple-web-scraper
description: Simple web scraper for extracting data from websites.
version: 0.0.4
runtime: nodejs_v8
keywords:
- simple web scraping
- xpath
- css
- json
- xml
endpoints:
scraping:
description: Scrapes webpage and returns xpath or css selectors in xml or json format.
inputs:
properties:
url:
type: string
description: Webpage address to scrape from
examples:
- 'https://funnycatsgallery.com/'
selectorType:
type: string
description: Indicates the type of selector to use in scraping
long_description: |
Contents can be scraped using either `xpath` or `css` selector.
examples:
- xpath
extract:
type: string
description: Scraped Data readable format to return.
long_description: |
Data can be returned either in `json` or `xml` format.
examples:
- json
config:
type: object
description: Parameter for selecting the content you want to scrape.
examples:
- |
{
"config":
{
"title": "//*[@id='content_box']/article/header/h2/a/text()"
}
}
outputs:
success:
description: Success
required:
- message
properties:
message:
description: Scraping success data
examples:
- |
{
"message": "Webpage Scraped.",
"statusCode": 200,
"data": { title:[]}
}
fail:
exit_code: 400
description: Failed
required:
- message
properties:
message:
description: Error message
examples:
- >
{
"message": "Make sure to use GET request method for scraping
webpage",
"statusCode": 400,
"data": {}
}