I want to print some strings scraped by BeautifulSoup and they are not printed right. For "ü" I get "ü" and so on.
Here is my code
from bs4 import BeautifulSoup
import requests
import re
with open('index.html') as html_file:
for link in soup.find_all('a'):
print(link.get('href'))
EDIT
Found the solution myself. You have to open the file with the right encoding as follows:
open('index.html', encoding='utf8')