Skip to content
Advertisement

Python web-scraping error – TypeError: can’t use a string pattern on a bytes-like object

I want to build a web scraper. Currently, I’m learning Python. This is the very basics!

Python Code

JavaScript

Error:

JavaScript

Advertisement

Answer

You have to decode your data. Since the website in question says

JavaScript

use that. utf-8 won’t work in this case.

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