import sys import json import requests from bs4 import BeautifulSoup import codecs def scraping(url, output_name): # get a HTML response response = requests.get(url) html = response.text.encode(response.encoding) # prevent encoding errors # parse the response soup = BeautifulSoup(html, "lxml") # extract ## title header = soup.find("head") title = header.find("title").text ## description descriptio