Merge pull request #6 from thehappydinoa/patch-1

Update blazy.py
This commit is contained in:
Ultimate Hackers
2017-11-07 12:32:43 +05:30
committed by GitHub

View File

@@ -7,6 +7,7 @@ import sys
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from re import search, findall from re import search, findall
from urllib import urlopen from urllib import urlopen
from urllib2 import URLError
#Stuff related to Mechanize browser module #Stuff related to Mechanize browser module
br = mechanize.Browser() #Shortening the call by assigning it to a varaible "br" br = mechanize.Browser() #Shortening the call by assigning it to a varaible "br"
# set cookies # set cookies
@@ -41,8 +42,8 @@ elif 'https://' in url:
else: else:
url = 'http://' + url url = 'http://' + url
try: try:
br.open(url) #Opens the url br.open(url, timeout=10.0)) #Opens the url
except urllib2.URLError as e: except URLError as e:
url = 'https://' + url url = 'https://' + url
br.open(url) br.open(url)
forms = br.forms() #Finds all the forms present in webpage forms = br.forms() #Finds all the forms present in webpage