2
有人知道如何做美丽的汤:Python的LIB使用aiohttp
import html5lib
import urllib
from bs4 import BeautifulSoup
soup = BeautifulSoup(urllib.request.urlopen('http://someWebSite.com').read().decode('utf-8'), 'html5lib')
使用urllib模块aiohttp呢?
谢谢^^
我很好奇,为什么你想这样做。 –
因为urllib阻塞。我需要一个非阻塞的图书馆 – APianist
我无法提供有关您的问题的直接建议。但是,我知道阻塞也可能会在超时时出现。你可能会对这个页面感兴趣:http://docs.python-requests.org/en/latest/user/advanced/#asynchronous-requests('Blocking or Non-Blocking?'and'Timeouts') –