on-internet
← Community

Scraping EDGAR with Python code (Program 2) results in TypeError: a bytes-like object is required, not 'str'

Stack Overflow ·

I am trying to get the (10-K) filing of Amazon in the year of 2013. My Python program for this is not working, perhaps due to the Python version difference between Python 2's urllib2 and Python 3's urllib, I suppose. My problem is that I encountered the initial error: TypeError: a bytes-like object is required, not 'str' Please help me to get the result of "element4" other than "None" for the code and error below; import time import csv import sys CIK = '1018724' Year= '2013' FILE= '10-K' # Get the Master Index File for the given Year url='https://www.sec.gov/Archives/edgar/full-index/%s/QTR1/

Comments

Sign in or sign up to comment and upvote.

No comments yet.