# Path: collectors/takeda/spider.py
# class Spider(CrawlSpider):
# 
#     # Public
# 
#     name = 'takeda'
#     allowed_domains = ['takedaclinicaltrials.com']
# 
#     def __init__(self, conf=None, conn=None):
# 
#         # Save conf/conn
#         self.conf = conf
#         self.conn = conn
# 
#         # Make urls
#         self.start_urls = [
#             'http://www.takedaclinicaltrials.com/browse/?protocol_id=',
#         ]
# 
#         # Make rules
#         self.rules = [
#             Rule(LinkExtractor(
#                 allow=r'browse/summary/',
#             ), callback=parse_record),
#             Rule(LinkExtractor(
#                 allow=r'browse',
#             )),
#         ]
# 
#         # Inherit parent
#         super(Spider, self).__init__()


from scrapy.crawler import CrawlerProcess
from .spider import Spider
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals



# Module API

def collect(conf, conn):
    process = CrawlerProcess(conf['SCRAPY_SETTINGS'])

# Path: collectors/takeda/spider.py
# class Spider(CrawlSpider):
# 
#     # Public
# 
#     name = 'takeda'
#     allowed_domains = ['takedaclinicaltrials.com']
# 
#     def __init__(self, conf=None, conn=None):
# 
#         # Save conf/conn
#         self.conf = conf
#         self.conn = conn
# 
#         # Make urls
#         self.start_urls = [
#             'http://www.takedaclinicaltrials.com/browse/?protocol_id=',
#         ]
# 
#         # Make rules
#         self.rules = [
#             Rule(LinkExtractor(
#                 allow=r'browse/summary/',
#             ), callback=parse_record),
#             Rule(LinkExtractor(
#                 allow=r'browse',
#             )),
#         ]
# 
#         # Inherit parent
#         super(Spider, self).__init__()


# Path: collectors/takeda/collector.py
from scrapy.crawler import CrawlerProcess
from .spider import Spider

# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals



# Module API

def collect(conf, conn):
    process = CrawlerProcess(conf['SCRAPY_SETTINGS'])

    process.crawl(Spider, conn=conn)