Python 爬取网站数据

一、使用request库实现批量下载HTML

二、使用BeautifulSoup库实现html解析
官网:https://beautifulsoup.readthedocs.io/zh_CN/v4.4.0/

问题:
1)NotImplementedError: Only the following pseudo-classes are implemented: nth-of-type.
当使用copy selector时,复制的是nth-child,而soup 似乎不支持nth-child,所以会报以上错误:
将nth-child 改为 nth-of-type 就可以了。

posted @ 2021-12-02 17:19  D·Kingson.Mo  阅读(44)  评论(0)    收藏  举报