Scraping publicly available data is legal. However, it becomes a problem when data is protected or the amount of data you scrape is so large that it starts to be a problem for the site you're scraping. In general, respect the ToS and the robots.txt file. Even then the website might still block your IP or make it more difficult for you to scrape their site.