I am trying to web-scrape the table with python, and I don’t understand why am I getting this error typeerror

  beautifulsoup, findall, python-3.x

import requests
import sys
import pandas as pd
from bs4 import BeautifulSoup

file_html=open("Data/Html_Data/{}/{}.html".format(2015,1),"rb")
plain_text=file_html.read()

tempD=[]
finalD=[]

soup=BeautifulSoup(plain_text,"lxml")
for table in soup.findALL(‘table’,{‘class’:’medias mensuales numspan’}):
for tbody in table:
for tr in tbody:
a=tr.get_text()
tempD.append(a)

rows=len(tempD)/15

for times in range(round(rows)):
newtempD=[]
for i in range(15):
newtempD.append(tempD[0])
tempD.pop(0)
finalD.append(newtempD)
Traceback (most recent call last):

File "", line 8, in
for table in soup.findALL(‘table’,{‘class’:’medias mensuales numspan’}):

TypeError: ‘NoneType’ object is not callable

Source: Python-3x Questions

LEAVE A COMMENT