Some people consider web scraping as a hacking tool, I personally tell them that it is much more than that, today it is widely used in the part of E-commerce, journalism, call center among others. In this blog we will work with a python module called beautifullsoup4 which is a web sacraping specialist and with which you can do many wonderful things.
My great advice is before doing or testing anything in python you must create a virtual environment as shown in the following image.
python3 -m venv env3
After that install the module with the we will work, you can install all the modules you need or want in this case we will only install a single one called beutifullsoup4
pip install beautifulsoup4
We start our code editor with the following command you must make sure it is for python 3 as it appears in the following image.
I’m going to make a simple example so that you understand the concept and see how to implement this technique in your work or any place you want.
With the following code, what we do is enter the previous website and take the value of the temperature of the city of New York and print it on the console, although you can send it by mail or save it in a spreadsheet or a data base etc. ..
Here we have the answer, the consulate is done every 15 seconds.
This you can do on another website, for example monitor the price of an item and send you an email when it decreases its price or goes into promotion, there are many features that we can get from this module.
If you are interested in continuing to learn this type of hacking tricks, do not forget to visit our website.
Related infoscaddicts courses: