ul = bs.find("div",attrs={"class":"nav-con"})
时间: 2023-09-23 22:07:55 浏览: 166
attrs-strict:提供对基于Python'attr'的数据类中指定的属性的运行时验证
ul = bs.find("div", attrs={"class":"nav-con"})是通过BeautifulSoup库中的find方法,在bs对象上查找标签为div,属性为class为nav-con的元素。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Python 实现简单的爬虫](https://blog.csdn.net/zihong522/article/details/122348086)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文