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: Nov 18, 2018 5:22 PM
Views: 19
  1. import requests
  2. from bs4 import BeautifulSoup
  3. url = 'http://sapo.pt'
  4. url_get = requests.get(url)
  5. soup = BeautifulSoup(url_get.content, 'html.parser')
  6. tag = soup.find('title')
  7. print(tag.text)
  8.