This repository was archived by the owner on Sep 1, 2022. It is now read-only.
File tree 2 files changed +9
-11
lines changed
2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -31,22 +31,20 @@ def checkTitle(argv):
31
31
for line in f :
32
32
try :
33
33
line2 = line .strip ()
34
- url = 'https ://' + line2
34
+ url = 'http ://' + line2
35
35
try :
36
- result = requests .get (url )
37
- soup = bs (result .content , 'lxml' ).encode ("utf-8" )
38
- title = soup .select_one ('title' ).text
36
+ headers = {'User-Agent' : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36' }
37
+ result = requests .get (url , headers = headers ).content
38
+ soup = bs (result , 'html.parser' )
39
+ title = soup .find ('title' )
39
40
print ('' )
40
- print (' [+] URL Title: ' + title )
41
+ print (' [+] URL Title: ' + str ( title . text ) )
41
42
print (' [+] URL: ' + url )
42
43
print (' [+] URL Status: ' + result .status_code )
43
44
except :
44
- print ('' )
45
- print (' [x] No title found' )
46
- print (' [x] URL: ' + url )
47
- print (' [x] URL Status: ' + result .status_code )
45
+ pass
48
46
except :
49
- print ( ' [x] Error' )
47
+ pass
50
48
51
49
if (len (sys .argv )) == 2 :
52
50
try :
@@ -60,4 +58,4 @@ def checkTitle(argv):
60
58
print (' [x] Can\' t find your ' + sys .argv [1 ] + ' file.' )
61
59
else :
62
60
usage ()
63
- sys .exit (0 )
61
+ sys .exit (0 )
You can’t perform that action at this time.
0 commit comments