Merge pull request #25 from NotoriousRebel/dev

Added docstring.
This commit is contained in:
Matt
2019-12-30 23:08:26 -05:00
committed by GitHub
+2
View File
@@ -25,6 +25,7 @@ class SearchNetcraft:
async def request(self, url, first=False):
try:
if first:
# indicates first request to extract cookie
async with aiohttp.ClientSession(headers=self.headers, timeout=self.timeout) as sess:
async with sess.get(url) as resp:
await asyncio.sleep(3)
@@ -57,6 +58,7 @@ class SearchNetcraft:
async def get_cookies(self, headers):
try:
if headers is None:
# In this case just return default dict
return {}
elif 'set-cookie' in headers:
cookies = await self.create_cookies(headers['set-cookie'])