Giter Club home page Giter Club logo

webmd_spider's Introduction

WebMD Spider

In this project, I use Python's Scrapy library to crawl https://www.webmd.com/drugs/2/index and extract the name and usage of all the drugs present. The code is ran using a Jupyter notebook or Google Colab or any other similar notebook interpreter. We export our crawled findings to a .csv file. The data acquired here may be used to cross-reference other medical datasets such as those from the CDC to perform EDA or other investigations on drug data.

I manually extracted each relevant XPath on WebMD's drug pages using Chrome DevTools (inspect element) to make the retrieval process more precise. Some pages on WebMD are different that others. For example, this page https://www.webmd.com/drugs/2/drug-63164/adderall-xr-oral/details is different from https://www.webmd.com/drugs/2/drug-7277/percocet-oral/details which means they are constructed using different HTML elements and thus require a custom XPath extraction.

The spider extracts the following data from each drug page:

  • Drug Name
  • Usage
  • Condition
  • How to Use
  • Generic Name
  • Brand Name

Here's a snapshot of what the output .csv file looks like:

Snapshot

Tools

webmd_spider's People

Contributors

amirucr 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.