Answer by Samsul Islam for Empty return when trying to get title attriubute...
Here b is returning li tag with a tag. so to catch the title use b.a then title text.import requestsfrom urllib.request import urlopenfrom bs4 import BeautifulSoupres =...
View ArticleAnswer by HedgeHog for Empty return when trying to get title attriubute in...
What happens?You grab all the <li> and try to print a title, but <li> do not have a titleIt is the <a> that contains a title, so print:print(b.a["title"])Exampleimport requestsfrom...
View ArticleEmpty return when trying to get title attriubute in BeautifulSoup
I am trying to get all the names of programming languages from here.import requestsfrom urllib.request import urlopenfrom bs4 import BeautifulSoupres =...
View Article