简体   繁体   English

美丽的汤找不到HTML元素

[英]Beautiful Soup Not Finding HTML Element

We are attempting to find the html element "c_pagination_list" on the following Forever21 page: http://www.forever21.com/Product/Category.aspx?br=21men&category=mens-tops . 我们试图在下面的Forever21页面上找到html元素“ c_pagination_list”: http : //www.forever21.com/Product/Category.aspx ?br=21men&category=mens-tops。 However, when we use BeautifulSoup to get this element, it returns empty or None. 但是,当我们使用BeautifulSoup获取此元素时,它返回空或无。 Below are the following ways we attempted to get this element: 以下是我们尝试获取此元素的以下方法:

numberArray = soup.findAll('div', attrs={ 'class' : 'c_pagination_list'})

number = soup.find('div', class_='c_pagination_list')

number = soup.select('div.c_pagination_list')

Can anyone help explain what the proper syntax for getting this information or what we're missing here? 谁能帮助解释获取此信息的正确语法是什么,或者我们在这里缺少什么?

use this: 用这个:

numberArray = soup.findAll('div', {'class': 'c_pagination_list'})

I think this should work. 我认为这应该有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM