1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-11-01 21:02:38 +00:00

Formatting tweaks

This commit is contained in:
Myned 2017-10-14 21:54:29 -04:00
parent 33891cb409
commit 84f45d4f7d

View file

@ -1,4 +1,3 @@
import aiohttp as aio
from bs4 import BeautifulSoup
from lxml import html
@ -8,10 +7,13 @@ from utils import utils as u
async def check_match(url):
r = await u.fetch('http://iqdb.harry.lu/?url={}'.format(url))
soup = BeautifulSoup(await r.read(), 'html.parser')
value = soup.find_all('a')[1].get('href')
try:
value = BeautifulSoup(await r.read(), 'html.parser').find_all('a')[1].get('href')
except IndexError:
raise exc.MatchError
if value != '#':
return value
else:
raise exc.MatchError(value)
raise exc.MatchError