-
Notifications
You must be signed in to change notification settings - Fork 5
/
INPUT_SCHEMA.json
22 lines (22 loc) · 1.27 KB
/
INPUT_SCHEMA.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"title": "Scrapy Executor",
"type": "object",
"schemaVersion": 1,
"properties": {
"scrapyCode": {
"title": "Scrapy spider",
"type": "string",
"description": "Paste your Python code with a Scrapy spider here. If your spider consists of multiple files, see readme for instructions.",
"prefill": "import scrapy\nimport apify\n \nclass MySpider(scrapy.Spider):\n \tname = 'apifySpider'\n \n \tdef start_requests(self):\n \t\turls = [\n \t\t\t'https://apify.com',\n \t\t\t'https://apify.com/store',\n \t\t]\n \t\tfor url in urls:\n \t\t\tyield scrapy.Request(url=url, callback=self.parse)\n \n \tdef parse(self, response):\n \t\turl = response.url\n \t\ttitle = response.css('title::text').get()\n \t\toutput = {\n \t\t\t'url': url,\n \t\t\t'title': title\n \t\t}\n \t\tapify.pushData(output)",
"editor": "python"
},
"proxyConfig": {
"title": "Proxy",
"type": "object",
"description": "Proxy servers let you bypass website protections, avoid IP address blocking and view content for other countries. Try to use the proxy if you are experiencing timeout errors.",
"default": {},
"editor": "proxy"
}
},
"required": ["scrapyCode"]
}