Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Mario Lopes
Added: Mar 20, 2018 12:13 PM
Views: 13
Este código mostra há quanto tempo uma página não é atualizada
  1. import requests
  2. from bs4 import BeautifulSoup
  3. import re
  4. url = "http://www.webconfs.com/domain-age.php"
  5. domain = 'youtube.com'
  6. r = requests.post(url, {'domains': domain, 'submit': 'submit'})
  7. soup = BeautifulSoup(r.content)
  8. for item in soup.find_all('a', href=re.compile('website-history')):
  9. ...     print item.text
  10. ...
  11. 9 years 0 months old