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))

评论

暂无评论