At first, it might look like web scraping is illegal, but multiple rulings between big web services and web scrapers in US court have cleared the air – web scraping is legal.
However, it can still be illegal, depending on your use case. While web scraping is legal, websites do not like being scraped and put up a defense in the form of anti-bot systems. You will have to bypass the anti-bot systems to be able to scrape these websites.