Basically a python script is a code written in python that when executed can perform a specific action.
The short answer is that Web scraping is the act of extracting data from a website. Web scrapping isn't illegal, however, we have to follow some rules, otherwise we are doing something illegal when we extract non publicly available data.
Yes, before scraping the website, check the robots.txt file. Once I did that, I was sure that what I was doing was not within the illegal scope and that by doing so I was not harming anyone.
XPath is a language that allows you to locate specific elements of a page, it can be used to navigate through elements and attributes in an XML document, but it can also be used in HTML files.
https://platzi.com/cursos/web-scraping/
https://en.wikipedia.org/wiki/XML
https://en.wikipedia.org/wiki/Web_scraping