There's no obvious answer to your question without more information (for example, where are you?) but I'm not aware of scraping being illegal anywhere, with some exceptions. For example, in the US (where I am), as long as you're not doing "illegal hacking" to scrape your data, you're probably fine.
There are TOSs that websites like to impose as well. If you have to agree to one to access any data, you should follow it. Breaking the TOS isn't really "illegal" in a criminal sense (in the US), but you may expose yourself to anything from being blocked from the site to a lawsuit. Bypassing blocks might also be illegal, though you'd have to speak to a lawyer to know more about that.