remove unicode from string python 1

remove unicode from string python

.encode("ascii", "ignore")

Here is what the above code is Doing:
1. We’re using the BeautifulSoup library to parse the HTML.
2. We’re telling BeautifulSoup to use the lxml parser.
3. We’re creating a BeautifulSoup object called soup from the HTML.
4. We’re telling BeautifulSoup to find all the tags on the page.
5. We’re telling BeautifulSoup to loop through all the
tags and get the text out of each one.
6. We’re telling BeautifulSoup to loop through all the
tags and get the href attribute out of each one.
7. We’re printing out the text and the href attribute for all the
tags.

Similar Posts