📜  如何使用美丽汤使用 cssselector 获取元素细节 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:52.192000             🧑  作者: Mango

代码示例1
soup.select('div')
All elements named 
soup.select('#author') The element with an id attribute of author soup.select('.notice') All elements that use a CSS class attribute named notice soup.select('div span') All elements named that are within an element named
soup.select('div > span') All elements named that are directly within an element named
, with no other element in between soup.select('input[name]') All elements named that have a name attribute with any value soup.select('input[type="button"]') All elements named that have an attribute named type with value button