[Fixed]-How can I scrape a elements and store text, href and src and then use them in my Django template

1👍

That depends on how you want to store each triple values. For example, you can store them in a python dictionary :

links = [{'text': link.text,
          'href': link.get('href'),
          'src': link.get('src')
          } for link in a_links]

which later can be accessed using the dictionary key :

for link in links:
    print link['text'], link['href'], link['src']
👤har07

Leave a comment