Skip to content

Instantly share code, notes, and snippets.

@shumon84
Created May 6, 2018 12:47
Show Gist options
  • Save shumon84/6bb84ee4c7e96db205a3eb293dbfbc4d to your computer and use it in GitHub Desktop.
Save shumon84/6bb84ee4c7e96db205a3eb293dbfbc4d to your computer and use it in GitHub Desktop.
import urllib2
from bs4 import BeautifulSoup
import sys
import codecs
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
url = sys.argv[1]
html = urllib2.urlopen(url)
soup = BeautifulSoup(html, "html.parser")
title = soup.find("title")
print(title.string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment