Crawling using beautiful soup 4

'''
import requests
import re
from bs4 import BeautifulSoup

target_url = 'https://www.poftut.com/python-main-function-use/'

def download_page(page_url):
	print(page_url)
	try:
		return requests.get(page_url).text
	except Exception as e:
		print ("Error: invalid ip and port", e)

def parse_page(page):
	tags = []
	soup = BeautifulSoup(page, 'html.parser')
	for tag in soup.find_all(re.compile("t")):
		tags.append(tag.name)
	return tags

def main():
	print('Basic with BeautifulSoup is starting...')
	page = download_page(target_url)
	tags = parse_page(page)
	print(tags)
main()