Skip to content
Advertisement

Need help scraping WSJ Markets Data

I am relatively new and trying to use Python to scrape data. Here is my code:

JavaScript

I have already added headers, but the output shows no value. Any help would be greatly appreciated, thanks!

Advertisement

Answer

The data you’re looking for is loaded from external source via Ajax. You can use next example how to load it with requests module:

JavaScript

Prints:

JavaScript

To load it as panda’s DataFrame:

JavaScript

Prints:

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