From eba8c7cd419cc86c05acdcc3ba423db3e2884bba Mon Sep 17 00:00:00 2001 From: Jean Paul Gotopo Maldonado Date: Thu, 27 Jan 2022 14:43:27 -0500 Subject: [PATCH] =?UTF-8?q?Agregando=20codificaci=C3=B3n=20a=20texto=20a?= =?UTF-8?q?=20exportar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Se agrega el encoding='utf-8' para que no arroje error UnicodeEncodeError: 'charmap' codec can't encode character '\ufb02' in position 32153: character maps to --- spanish/Web Scraping con Beautiful Soup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spanish/Web Scraping con Beautiful Soup.py b/spanish/Web Scraping con Beautiful Soup.py index 08c036b..095ba2e 100644 --- a/spanish/Web Scraping con Beautiful Soup.py +++ b/spanish/Web Scraping con Beautiful Soup.py @@ -15,5 +15,5 @@ transcript = box.find('div', class_='full-script').get_text(strip=True, separator=' ') # Exportar data en un archivo txt con el nombre de la variable titulo (title) -with open(f'{title}.txt', 'w') as file: +with open(f'{title}.txt', 'w', encoding='utf-8') as file: file.write(transcript)