3. Is it legal?

Web Scraping is the technique of automatically extracting data from websites using software/script. Because the data displayed by most website is for public consumption. It is totally legal to copy this information to a file in your computer. But it is regarding how you plan to use this data that you should be careful about. If the data is downloaded for your personal use and analysis, then it is absolutely ethical. But in case you are planning to use it as your own, in your website, in a way which is completely against the interest of the original owner of the data, without attributing the original owner, then it is unethical, illegal.

4. Libraries used for Web Scraping

There are a certain libraries available for Web Scraping which is mentioned are BeautifulSoup, Requests, Selenium, lxml, Scrapy, In this example problem weare using Selenium library for data extraction.