code can only run the first time. after that I found a mistake : TypeError: 'str' object is not callable
create :
soup = BeautifulSoup(r.content, "lxml")
berat = soup.find_all("dd", {"class": "pull-left m-0 border-none"})[0].text
var1 = str(berat)
str = string.maketrans('us', '12')
result = var1.translate(str)
print (result)
output error
Beka2
Traceback (most recent call last):
File "current.py", line 67, in <module>
var1 = str(berat)
TypeError: 'str' object is not callable
enough to make me confused: I want output : Baru = Bar1 Bekas = Beka2