Пример #1
0
def crawl():
  url = request.get_json()['url']

  crawler = Crawlr(url)
  data = crawler.crawl()

  payload = {
    'status': 'OK',
    'url': data['url'],
    'id': data['id'],
    'crawled_at': data['crawled_at'],
    'title': data['title'],
    'body': data['body'],
    'internal_links': data['internal_links'],
    'outbound_links': data['outbound_links']
  }

  return jsonify(payload)
Пример #2
0
def crawl(url):
  new = Crawlr(url)
  return new.crawl()