2021年1月5日星期二

Accessing div in multiple div in BeautifulSoup4

I'm just learn BeautifulSoup and Python just around 4 days ago for my project, and now having troubles in accessing multiple div from here :

enter image description here

My intention is to get the value "DIY Proj Ent" from the
, thus I tried to access via :

AccName = soup.find('div', {'class' : 'comProfile_hld row'})  print(AccName.get_text())  

With this code, I got : AttributeError: 'NoneType' object has no attribute 'get_Text'

Then I change the print part into : print(AccName), but got 'None' as the result.

So, how can I access the value which having multiple layer of div directly? Is beautifulsoup4 really can access div via the div name?

Thanks a lot!

https://stackoverflow.com/questions/65590057/accessing-div-in-multiple-div-in-beautifulsoup4 January 06, 2021 at 12:06PM

没有评论:

发表评论