Giter Site home page Giter Site logo

adaptapi's Introduction

AdaptAPI Take Home Project

For this most excellent takehome exercise, I have elected to use the awesome library Scrapy, which lets you build fast, high-concurrency web spiders that extract and organize the data that you want and/or need extremely efficiently and easily while addressing login, authentication and session concerns.

I'm also using the Scrapy-Splash plugin which doesn't just run javascript to allow you to wait for dynamic content to load, it also has facilities for doing things like scrolling down for the emulated browser (running in a docker container) to load additional dynamic content.

Running the Splash engine

First, if you don't already have Docker Desktop, download here.

For Mac and Windows, you should then be able download the Splash image in a terminal with the following:

docker pull scrapinghub/splash

and then you should be able to run the rendering engine with the following:

docker run -it -p 8050:8050 --rm scrapinghub/splash

Running the spiders

  1. Download the code

git clone [email protected]:damzam/AdaptAPI.git

  1. Change directory into AdaptAPI

cd AdaptAPI

  1. Create a virtual environment to protect your system python

python3 -m venv .env

  1. Activate the virtual environment

source .env/bin/activate

  1. Install dependencies

pip install scrapy scrapy-splash

  1. cd into the scraper directory

cd scraper

  1. Load the seed urls from input.json (copied from the take home assignment) and run the respective spiders to scrape the MOCK_INDEMNITY and PLACEHOLDER_CARRIER content and log it out to the console with the following command:

make

Clean Up

  1. Remove the local repo

  2. Terminate the docker process and remove the image

docker rmi scrapinghub/splash

And you're done!

adaptapi's People

Contributors

damzam avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.