how to fix for the "AttributeError: 'str' object has no ...
stackoverflow.com › questions › 60575687Mar 07, 2020 · When you feed in an html source into a BeautifulSoup object, you want to feed it in as a string. Since you already have it as a string when you use url.read (), so there is no need to convert that into a string with .content, hence the error of, there is no content attribute on a str. Simply remove that line to fix the issue. n=0 link = coverpage_news [n] ['href'] title = coverpage_news [n].get_text () article_content = url.read () soup_article = BeautifulSoup (article_content, 'html5lib')