Skip to content
Advertisement

Python scraping website shows unknown url type: view-source

I am trying to do scraping in Python.

Then, I want to scrape a stock-info website. But I failed, I don’t know why.

JavaScript

It gives the error below:

JavaScript

But when I used Chrome I can view the source code by right-click.

Advertisement

Answer

Try removing view-source: from your url_src, in essence:

JavaScript

I think view-source: is Chrome specific (so Chrome knows to show you source rather than the webpage).

Advertisement