Created
May 6, 2018 12:47
-
-
Save shumon84/6bb84ee4c7e96db205a3eb293dbfbc4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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