python 的 goose3 如何配置 ip 代理
文章目录
from goose3 import Goose
from goose3.text import StopWordsChinese
from loguru import logger
import json
proxy = 'http://xxxxx:xxxxx@xxx.xxx.xxx.xx:xxxx'
http_proxies = {
'http': proxy,
'https': proxy
}
url = 'https://www.88mv.org/guochanju/202310/229277.html'
g = Goose({'stopwords_class': StopWordsChinese,
'enable_image_fetching': True,
'http_proxies': http_proxies})
article = g.extract(url=url)
logger.debug(json.dumps(article.infos, indent=4, ensure_ascii=False))
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论