【发布时间】:2013-07-20 23:10:54
【问题描述】:
我正在尝试从页面中获取 input 标签,但我不想返回任何带有 type 属性的标签,hidden。
我可以用soup.find_all('input', attrs={'type': 'hidden'}) 获得所有hidden 字段,但你不能用attrs!={'type': 'hidden'} 来否定它。
是否有一种简单的单行方式来获取所有不与给定属性的条件匹配的标签?
【问题讨论】:
标签: python python-2.7 beautifulsoup