I am making a project that requires data from imdb business page.I m using python. The data is stored between two tags like this :
Budget$220,000,000 (estimated)
I want the numeric amount but have not been successful so far. Any suggestions.
I am making a project that requires data from imdb business page.I m using python. The data is stored between two tags like this :
Budget$220,000,000 (estimated)
I want the numeric amount but have not been successful so far. Any suggestions.
Well you asked for python and you asked for a scraping solution.
But there is no need for python and no need to scrape anything because the budget figures are available in the business.list text file available at http://www.imdb.com/interfaces
Try IMDbPY and its documentation. To install, just
pip install imdbpy
Though I'm not sure where to find specifically budget info
This is whole bunch of code (you can find your requirement here).
The below Python script will give you,
1) List of Top Box Office movies from IMDb
2) And also the List of Cast for each of them.
Output (run in terminal):
Take a look at Beautiful Soup, its a useful library for scraping. If you take a look at the source, the "Budget" is inside an
h4
element, and the value is next in the DOM. This may not be the best example, but it works for your case: