Python3.6 BeautifulSoup无效 [英] Python3.6 BeautifulSoup is not working

查看:336
本文介绍了Python3.6 BeautifulSoup无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码如下;

source_code = requests.get(kale_url_keys)
plain_text = source_code.text
soup = BeautifulSoup("plain_text ")

r = requests.get(kale_url_keys)
html = r.content
soup = BeautifulSoup(html, "html.parser")

我写下汤= BeautifulSoup(ANYTHING)时出错,如下所示;

I took error when I writing the "soup = BeautifulSoup(ANYTHING)" like below;

推荐答案

做两件事:


  • 安装最新的稳定 Python 3.6.0

  • update beautifulsoup4 - 确保在正确的Python 3.6.0环境中更新它:

  • install the latest stable Python 3.6.0
  • update beautifulsoup4 - make sure you update it in the correct Python 3.6.0 environment:

pip3 install beautifulsoup4 --upgrade


这篇关于Python3.6 BeautifulSoup无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆