V
V
Vlad_beg2018-07-14 11:53:48
Python
Vlad_beg, 2018-07-14 11:53:48

How to save the html file of the entity in csv when parsing using bs4?

I wrote a simple parser for an online store, but when saving the html structure to a csv file, incomprehensible characters are produced, I tried to encode in utf-8, but when I use this code to insert into another resource, they are not converted to html entities. How can this problem be solved.
An example of how it looks on the site
<li>Key Switch: Blue switch&nbsp;</li>
When saving to a file
<li>Key Switch: Blue switch </li>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-07-15
@dimonchik2013

write in binary mode

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question