No, web scraping is, in general, legal, which is why commercial search engines exist. However, there are some considerations to be made:
Some websites might have terms and conditions that do not allow scraping at all;
Technically speaking, scraping is a task that consumes a significant amount of bandwidth and computational resources. We shall do it only when it is needed. Google itself is reviewing its indexing policies to be more environmentally friendly; we should do it too;
How we use the extracted data makes a huge difference.