March 12, 2020 Python Q&A

Topics Covered in this Session:

  • Collecting FinVis.com stock screener data into Python
  • Part 1 of using Python to read and write Google Sheets

Code for Collecting FinViz.com stock screener data

# -*- coding: utf-8 -*-
"""
Created on Thu Mar 12 07:45:26 2020

@author: Bruce1
"""

import pandas as pd

url = 'https://finviz.com/screener.ashx?v=111&f=ind_aluminum,sec_basicmaterials'

df = pd.read_html(url, header=0)[14]

print(df[['Ticker','Price']])