Advertisement
Guest User

ScrapeBot config example v2

a guest
Oct 16th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 2.23 KB | None | 0 0
  1. [
  2.     {
  3.         "type": "proxy_list",
  4.         "list": [
  5.             "145.12.11.22",
  6.             "45.88.125.255"
  7.         ]
  8.     },
  9.     {
  10.         "type": "user_agents",
  11.         "list": [
  12.             "Mozilla 55.0",
  13.             "Scrapy"
  14.         ]
  15.     },
  16.     {
  17.         "type": "log_file",
  18.         "value": "log.log"
  19.     },
  20.     {
  21.         "type": "error_file",
  22.         "value": "error.log"
  23.     },
  24.     {
  25.         "type": "email",
  26.         "to": "royal@bs.com",
  27.         "conditions": [
  28.             {
  29.                 "event": "on_finish"
  30.             },
  31.             {
  32.                 "event": "on_keyword",
  33.                 "keyword": "shit"
  34.             }
  35.         ]
  36.     },
  37.     {
  38.         "type": "config_setting",
  39.         "option": "DISABLE_COOKIES",
  40.         "value": 1
  41.     },
  42.     {
  43.         "type": "config_setting",
  44.         "option": "REQUEST_DELAY",
  45.         "value": 2
  46.     },
  47.     {
  48.         "type": "scrape_rule",
  49.         "domain": "amazon.com",
  50.         "scrape_data": [
  51.             {
  52.                 "output_file": "amazon_data.csv",
  53.                 "structure": [
  54.                     {
  55.                         "output_column": "price",
  56.                         "selector_sequence": [
  57.                             {
  58.                                 "command": "css",
  59.                                 "argument": "#priceblock_ourprice :text"
  60.                             },
  61.                             {
  62.                                 "command": "extract_first"
  63.                             }
  64.                         ]
  65.                     },
  66.                     {
  67.                         "output_column": "rating",
  68.                         "selector_sequence": [
  69.                             {
  70.                                 "command": "css",
  71.                                 "argument": "tr"
  72.                             },
  73.                             {
  74.                                 "command": "re",
  75.                                 "argument": "(\\d+|\\d+\\.\\d+) out of 5 stars"
  76.                             }
  77.                         ]
  78.                     }
  79.                 ]
  80.             }
  81.         ]
  82.     },
  83.     {
  84.         "type": "scrape_rule",
  85.         "domain": "example.com",
  86.         "scrape_data": []
  87.     }
  88. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement