Skip to content

Commit e4b8f45

Browse files
committed
Improve for gh-5
Signed-off-by: MikeMeliz <[email protected]>
1 parent 244d0aa commit e4b8f45

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

modules/extractor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def outex(website, outputFile, outpath):
6666
def termex(website):
6767
try:
6868
print urllib2.urlopen(website).read()
69-
except:
70-
e = sys.exc_info()[0]
71-
print("Error: %s" % e + "\n## Not valid URL \n## Did you forget \'http://\'?")
69+
except (urllib2.HTTPError, urllib2.URLError) as e:
70+
print("Error: (%s) %s" % (e, website))
71+
return None
7272

7373

7474
def extractor(website, crawl, outputFile, inputFile, outpath):

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
beautifulsoup4==4.4.1
1+
beautifulsoup4==4.7.1
22
requests==2.21.0
3-
urllib3>=1.24.2

0 commit comments

Comments
 (0)