Skip to content Skip to sidebar Skip to footer

How Can I Fix The Following Error Attributeerror: 'dict' Object Has No Attribute 'text'

I am a few months into programming. I am currently in the process of learning how to automate certain things in a project. My goal is to scrape text, src, and href and store the da

Solution 1:

You have to access dictionary keys like this:

entry['text']
entry['src']

Not like this

entry.text
entry.src

Solution 2:

In python you cannot access dictionary items using the syntax dict.key , If entry is a dictionary, you can use

  • entry['key1']
  • entry.get('key')

Post a Comment for "How Can I Fix The Following Error Attributeerror: 'dict' Object Has No Attribute 'text'"