Giter Site home page Giter Site logo

pythonscrappertest's Introduction

Python Phones and Logos Scrapper Test

Here, in this repository, you can find my solution to the Python challenge of the recruitment process for CIAL dun&bradstreet.

Using the Scrapy framework, the contactinfo spider can fetch phone numbers through a regex pattern and image logos urls through an attributes analysis.

Technical infos

  • Python version: 3.8.0
  • Main framework: Scrapy

Running

You can execute the script using both Docker or terminal.

Terminal

After cloning the repo and installing the correct Python version, you need to activate venv, Python's virtual environment, inside /pythonscrapptertest folder.

Then, still on this folder, execute the following command so Python can install all needed dependencies.

pip install -r requirements.txt

Pip will install all libraries that are used in this project, in the specific versions pointed in the requirements.txt file.

Finally, for the spider to run, you must go inside the scrapy project folder and run the main file (which is run.py), using a txt file with the websites to be scrapped. Note that there's already an example file, sites_example.txt::

Terminal:

cd contactscrapper/
cat ../sites_example.txt | python run.py

After that, you can watch the contactinfo spider execution logs, along with scrapped phone numbers and URL image logos.

Docker

After cloning the repo and installing Docker on your computer, go to /pythonscrappertest, project's root folder, where there is a Dockerfile. There, run the following command with your terminal:

Terminal:

sudo docker build -t pythonscrappertest .

Once the Docker image is ready, you can run it, using a txt file with the websites to be scrapped. Note that there's already an example file, sites_example.txt:

Terminal:

cat sites_example.txt | docker run -i pythonscrappertest

You can customize the sites file. Just remember to put one URL for each line.

After that, you can watch the contactinfo spider execution logs, along with scrapped phone numbers and URL image logos.

Contact

You can contact me through:

pythonscrappertest's People

Contributors

joaopedroguimaraes avatar

Stargazers

 avatar

Watchers

 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.