How to find elements by class

后端 未结 17 1712
有刺的猬
有刺的猬 2020-11-22 08:33

I\'m having trouble parsing HTML elements with \"class\" attribute using Beautifulsoup. The code looks like this

soup = BeautifulSoup(sdata)
mydivs = soup.fi         


        
17条回答
  •  庸人自扰
    2020-11-22 08:52

    You can refine your search to only find those divs with a given class using BS3:

    mydivs = soup.findAll("div", {"class": "stylelistrow"})
    

提交回复
热议问题