简体   繁体   中英

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 . However, when we use BeautifulSoup to get this element, it returns empty or None. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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