Introduction to NetworkX in Python to analyze global relationships between oil-producing countries.

Image for post
Image for post
Photo by NASA on Unsplash


Please don’t iterate over rows to web scrape tables using Python’s Scrapy application.

Image for post
Image for post
Photo by Tomáš Malík on Unsplash


Should you use multithreading or multiprocessing to scrape stock price history faster on Yahoo Finance?

Image for post
Image for post
Photo by Andreas Klassen on Unsplash
  • Multithreading: One central processing unit or core in a multicore processor concurrently executes multiple threads of tasks together.
  • Multiprocessing: Two or more central processing units allocate mutliple tasks across the units.


The first step in any investor’s journey is to master the definitions of crucial company financial statistics and technical stock price measurements.

a page from a dictionary defining embankment and embargo.
a page from a dictionary defining embankment and embargo.
Photo by Sandy Millar on Unsplash

Stock market valuation measures

Intraday market capitalization


How to web scrape the stock market statistics tab on the Yahoo Finance website using Python.

newspaper showing the dow jones over the trailing 12 months.
newspaper showing the dow jones over the trailing 12 months.
Photo by Markus Spiske on Unsplash


Web scrape a list of stocks with upcoming ex-dividend dates from the Nasdaq API using the Python pandas, requests, datetime, and calendar modules.

calendar
calendar
Photo by Estée Janssens on Unsplash

Install & import required Python packages

import pandas, requests, datetime, calendar


Easily scrape historical cryptocurrency exchange data from the Yahoo Finance website using the Python coding language.

A phone with the chart of the price of the cryptocurrency, Bitcoin, on the screen on Robinhood platform.
A phone with the chart of the price of the cryptocurrency, Bitcoin, on the screen on Robinhood platform.
A phone with the chart of the price of the cryptocurrency, Bitcoin, on the screen.

Pip install packages

  • Datetime: A module containing classes to manipulate date and time objects. Included in Python standard library. Install not necessary.
  • Time: A set of functions to format time objects. Included in Python standard library. Install not necessary.
  • Requests: A Python HTTP library to make requests to specified URLs and receive a response from the URL.
  • Pandas: A data analysis library that reads HTML tables and converts them into a list of data frames.
  • lxml: A website parser module that converts element trees to dictionary objects.


U.S. foreign energy policy in Iran and Venezuela: A political activist from Honduras asks the U.S. Congress two crucial questions.

Oil field at sunset. An dark oil machine sits in the dark foreground against a red, orange sky. The sun is yellow.
Oil field at sunset. An dark oil machine sits in the dark foreground against a red, orange sky. The sun is yellow.
Photo by Zbynek Burival on Unsplash


Step by step instructions to scrape up to 25 years of a stock’s dividend history from Yahoo Finance using the datetime, requests, lxml and pandas Python modules.

Picture of a US 1 Dollar Bill. Federal Reserve Note. Python For Finance. Scrape Web Dividend History. Python. Stock Market.
Picture of a US 1 Dollar Bill. Federal Reserve Note. Python For Finance. Scrape Web Dividend History. Python. Stock Market.
Photo by NeONBRAND on Unsplash

Install and import external python libraries


Part 3: How to Scrape Data From Yahoo Finance with Python

A picture of Wall Street intersection sign in New York City between two skyscraper buildings. The stock market capital.
A picture of Wall Street intersection sign in New York City between two skyscraper buildings. The stock market capital.
Photo by Chris Li on Unsplash

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store