我正在使用newspaper3k内部的Scrapy解析方法。我想提取链接,但我不想再次获取网站。
是否可以使用这个方法:
newspaper.build(..)使用普通的html,这样我就可以调用.articles than?
发布于 2022-05-27 11:10:06
我找到了这个解决方案:
import httpx
from newspaper import Article
async def get_article(url):
with httpx.AsyncClient() as client:
response = await client.get(url)
article = Article(url)
article.set_html(response.text)
article.parse()https://stackoverflow.com/questions/68360767
复制相似问题