Skip to content
Advertisement

how to remove /n from list results?

Hello everyone I’m scraping a table and separating the headers and the body of the table into separate lists but the body data has a lot of ‘/n’ and I’m trying to remove them but I cant seem to get them out.

code:

JavaScript

Results:

JavaScript

As you can see in the table body results ‘n’ is in the way and I can figure out how to get rid of it. As I have 100’s of samples to pull with the same issue.

Advertisement

Answer

Using str.replace() and list comprehension:

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement