0

I want to get a tome stamp

timestamp_containers = page_soup.findAll("p", {"class":"tagline"})

And the output is

<p class="tagline ">submitted <time class="live-timestamp" datetime="2018-10-06T10:02:28+00:00" title="Sat Oct 6 10:02:28 2018 UTC">1 month ago</time> by <a class="author may-blank id-t2_4r97b5o" href="https://old.reddit.com/user/Lord_Mop">Lord_Mop</a><span class="userattrs"></span><span class="gilding-bar" data-subredditpath="/r/assassinscreed/"></span></p>

I want to get a specific element " title="Sat Oct 6 10:02:28 2018 UTC" But when I try

for eeee in timestamp_containers[0].time:
if eeee == " title":
    continue
print(eeee)

It failed. How do I get title in timestamp_containers[0].time?

wayne64001
  • 399
  • 1
  • 3
  • 13

1 Answers1

0
data = timestamp_containers[0].find('time').get('title')

looking at my output below, is this what you're needing?

In [10]: print (data)
Sat Oct 6 10:02:28 2018 UTC
chitown88
  • 27,527
  • 4
  • 30
  • 59