Skip to content

Commit 6fb810c

Browse files
only request head, improve the request speed
1 parent c73d37c commit 6fb810c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

findsth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
url=protocol + '://' + 'www.' + domainName + aTop
2020
logging.info('url is: %s',url)
2121
try:
22-
req=requests.get(url, timeout=10)
23-
code=req.status_code
22+
res=requests.head(url, timeout=10)
23+
code=res.status_code
2424
except requests.exceptions.ReadTimeout:
2525
code=-1
2626
except requests.exceptions.ConnectionError:

0 commit comments

Comments
 (0)