![]() ![]() Sys.exit("This script requires Beautiful Soup 4, Requests and Pandas.") If you need to be sure the modules are present at all, you can catch ImportError: import sys Just do it at the top of the source code file. There's no reason to import modules in the body of scrape_coin_marketcap(). Welcome to Code Review SE, nice first question! Here are some of my comments, not pertaining to performance: ![]() Master_df.to_csv('CoinMarketCap.csv', index = False) Soup = BeautifulSoup(res.content, 'lxml')ĭate = str(soup.find_all('h1')) Print(str(num_links) + " dates to be scraped.") #Scrape historical data from each time period ![]() #scrape a list of links to historical data #Download HTML of links to historical CoinMarketCap data I'm self taught so I'd love some advice on how to improve the code's functionality, speed, and readability. It works but it's somewhat slow and probably could be designed better. A site which records historical data for cryptocurrencies which unfortunately does not have a feature to download all of their data in one convenient file. I built a webscraper to take all the historical data from. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |