Skip to content

Instantly share code, notes, and snippets.

@pilate pilate/
Last active Dec 22, 2015

What would you like to do?
from HTMLParser import HTMLParser
import requests
import re
url_regex = "(https?:\/\/[^ ]+)"
class TitleParser(HTMLParser):
istitle = False
def handle_starttag(self, tag, attrs):
if tag == "title":
self.istitle = True
def handle_data(self, data):
if self.istitle:
self.title = data
self.istitle = False
def run(data, settings):
re_test =, data['payload'])
if re_test:
url =
r = requests.get(url)
parser = TitleParser()
return parser.title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.