chorsley / python-Wappalyzer

Python driver for Wappalyzer, a web application detection utility.
GNU General Public License v3.0
309 stars 122 forks source link

Fix type assertion #35

Closed RomaLash closed 4 years ago

RomaLash commented 4 years ago

I wrote little snippet: ` wappalyzer = Wappalyzer.latest()

async with aiohttp.ClientSession() as session:
    page = await session.get("http://example.com")

webpage = await WebPage.new_from_response_async(page)

` but when i start this, i have an error:

if regex.search(webpage.url): TypeError: expected string or bytes-like object

I found the problem. Response object from requests library has url field. And it works fine (cos url field has "str" type) But aiohttp.Response's field url has another type - "yarl.URL"

So we have to assert types.

Sorry for my language.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 86.207% when pulling 17d02c8d55d74707d999f16a5ec3de21b4086ad2 on RomaLash:master into 658f4a62401f3fcaf5cb84efd958a4dedfa7732a on chorsley:master.

tristanlatr commented 4 years ago

Thanks ! I'll merge that soon :)

RomaLash commented 4 years ago

btw could u release new version? Cause i tried to install lib from pip and it was lib for python 2.* :)

Command "python setup.py egginfo" failed with error code 1 in /tmp/pip-install-o7iksu9/BeautifulSoup/