Python 3.7 AttributeError: 'str' object has no attribute 'append'
Closed
Camarasama
Posts31Registration dateFriday November 14, 2014StatusMemberLast seenNovember 11, 2018
-
Updated on Nov 12, 2018 at 09:50 AM
Blocked Profile -
Nov 12, 2018 at 04:54 PM
Hello,
Greetings, please can you help me on the below issue?
am a self learner of python and having issue debugging the below code.
get below the error i get:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-98-c194ce619f5f> in <module>()
30 #extract the League Point
31 TierInfoLPs = page_html.find('span', class_="LeaguePoints").text
---> 32 TierInfoLPs.append(TierInfoLP)
33
34 # extract the Total Rank
AttributeError: 'str' object has no attribute 'append'
------------------------------------------------------------------------------
also when i don't put append methode, the result in the dataframe at the colonne of TierInfoLP, it comes with spaces, how to remove the spaces?
Thank you for your help.
# import library
from requests import get
from bs4 import BeautifulSoup as bs
import pandas as pd
from time import time
from time import sleep
from random import randint
from IPython.display import clear_output
from warnings import warn