Python text_content() returns bound method

49
November 13, 2019, at 4:40 PM

Can't figure out why this is returning as bound method HtmlMixin.text_content, trying to create a web-scraper and display the data in a dataframe. I have tried using text_content as well as text_content(). Also tried type casting as a string. Any ideas what the issue is?

i = 0
#iterate each row element
for t in T.iterchildren():
    data = t.text_content()
    #check if row is empty
    if i > 0:
        #convert numerical to int
        try:
            data = int(data)
        except:
            pass
        #append data to the x'th col
    col[i][1].append(data)
    #increment x
    i+=1
Dict = {title:column for (title, column) in col}
df = pd.DataFrame(Dict)
df.head()
READ ALSO
Python Sum Second Element of Tuple by First Element

Python Sum Second Element of Tuple by First Element

I have the following two lists in Python3:

45
Executing MapReduce MRJob code in Python and getting IndexError: list index out of range message

Executing MapReduce MRJob code in Python and getting IndexError: list index out of range message

Well, I am trying the mrjob library and the code I wrote is not working properlyI looked at it and it seems fine from the little that I know about MapReduce library

16
Is it possible to check if a string is in a class nested in a class in Python?

Is it possible to check if a string is in a class nested in a class in Python?

I have created a class in Python with classes nested in it:

41
Convert the multiple csv into mysql database

Convert the multiple csv into mysql database

I have an SQLite file of 18 million values, which I have changed into CSV files because It was not loading

18