0

I need to export the data-utime from the following line:

<abbr title="23/1/20, 10:52 &#x3c0;.&#x3bc;." data-utime="1579805539" data-shorten="1" class="_5ptz">

How can I do that? Played with soup.find() for a while but didn't find solution.

Tonechas
  • 13,398
  • 16
  • 46
  • 80
  • Does this answer your question? [Extracting an attribute value with beautifulsoup](https://stackoverflow.com/questions/2612548/extracting-an-attribute-value-with-beautifulsoup) – Cohan Jan 29 '20 at 14:48
  • If your url is public you can share it. – KunduK Jan 29 '20 at 15:13

1 Answers1

0

You can do a find and then a get to have the value of the attribute.

Like this:

utime = soup.find('abbr', {'class': '_5ptz'}).get('data-utime')
Maaz
  • 2,405
  • 1
  • 15
  • 21