python3.4.3 安装BeautifulSoup4:

  使用pip install 安装:

    在命令行cmd之后输入,pip install BeautifulSoup4

     BeautifulSoup4的使用:

    一位园友总结的很好。也可以直接看官网文档(有中文版的哦)。

 

问题:

1. 文档中这样写的 soup.select("p nth-of-type(3)"),在尝试时遇到错误'Unsupported or invalid CSS selector: "%s"' % token?

Python: 安装BeautifulSoup4

原因是不支持这样语法,改为这样soup.select("p:nth-of-type(3)")就好了。

相关文章:

  • 2021-11-30
  • 2021-07-21
  • 2022-01-24
  • 2021-05-24
  • 2022-02-15
  • 2021-08-25
  • 2022-12-23
  • 2021-10-26
猜你喜欢
  • 2021-12-31
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-10-28
  • 2022-12-23
相关资源
相似解决方案