page_grab = soup.find_all("ul",{"class":"news_list large"})
for i in page_grab:
print(i.href)
this is my code and it turns 'None' value
page_grab = soup.find_all("ul",{"class":"news_list large"})
for i in page_grab:
print(i.href)
this is my code and it turns 'None' value
It would probably be useful if we could see the ul tags in the HTML / any of the HTML.
Regardless, beautifulSoup returns a set of elements, so the for loop is correct.
However, beautifulSoup uses a get method on the element classes to obtain attributes, so you would use i.get('href') to get the href attribute value.
Perhaps this would be useful to look at: Extracting attribute with beautifulSoup