[ESP-ENG] Titulos y enlaces en spectrum.ieee.org || Titles and links in spectrum.ieee.org

avatar

Preview (4).png

Imagen diseñada con canva || Image designed with canva

Hola querido lector de mi blog. En esta oportunidad traigo para ti un nuevo script escrito en Python para que puedas obtener los títulos y enlaces de uno de los portales más prestigiosos del Internet, IEEE Spectrum .

IEEE Spectrum es una revista sobre tecnología, ingeniería y ciencias que se remonta desde 1884, esta revista pertenece al Instituto de Ingenieros Eléctricos y Electrónicos(IEEE) que ha realizado aportes muy importantes sobre tecnología y es responsable en la creación de estándares en el mundial, como sería el IEEE 802.11 y el IEEE 802.3 famosos en equipos de cómputos lo que actualmente conocemos como Ethernet y red inalámbrica.

Es una asociación de gran importancia en cuanto a la creación de normas a escala mundial con relación a la tecnología en aplicaciones electrónicas.

Así pues, este es uno de los sitios que encontraras información de excelente calidad y de vanguardia en muchas áreas temáticas así que encontraras noticias, informes especiales, podcasts, videos e infografías para ti.

En mi script solo lo utilicé para que obtenga la información que mencione con anterioridad en algunos tópicos que son de mi interés. Pero puedes efectuar modificaciones que sean necesarias(Por ejemplo, sustituyendo los enlaces por otros de tu interés) para que obtengas lo que buscas. Puedes usar este script para cuando despiertes en las mañanas puedes ver en tu consola de comandos los titulares principales que ofrece esta prestigiosa institución.

Sin más nada que agregar, abajo encontrara el script y su resultado.

Agradezco que hayas visitado esta breve publicación. Nos vemos en la próxima.

Este script fue ejecutado con Python 3.9.13 en el sistema operativo Lubuntu 18.0.4.

Hello dear reader of my blog. In this opportunity I bring for you a new script written in Python so you can get the titles and links of one of the most prestigious portals of the Internet, IEEE Spectrum .

IEEE Spectrum is a magazine about technology, engineering and science that dates back to 1884, this magazine belongs to the Institute of Electrical and Electronics Engineers (IEEE) that has made very important contributions on technology and is responsible for the creation of standards in the world, as would be the IEEE 802.11 and IEEE 802.3 famous in computer equipment what we now know as Ethernet and wireless network.

It is an association of great importance in terms of the creation of standards worldwide in relation to technology in electronic applications.

So, this is one of the sites that you will find excellent quality information and cutting edge in many subject areas so you will find news, special reports, podcasts, videos and infographics for you.

In my script I only used it to get the information I mentioned before in some topics that are of my interest. But you can make modifications as needed (for example, replacing the links with others of your interest) to get what you are looking for. You can use this script so that when you wake up in the morning you can see in your command console the main headlines offered by this prestigious institution.

Without further ado, below you will find the script and its result.

Thank you for visiting this brief publication. See you in the next one.

This script was run with Python 3.9.13 on the Lubuntu 18.0.4 operating system.

import httpx
from selectolax.parser import HTMLParser

headers={'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 Edg/87.0.664.75'}

urls=['https://spectrum.ieee.org/topic/artificial-intelligence/',
'https://spectrum.ieee.org/topic/robotics/',
'https://spectrum.ieee.org/topic/computing/',
'https://spectrum.ieee.org/topic/energy/']

urls_list=[urls_list for urls_list in urls]

for links in urls_list:

    client=httpx.Client()
    spectrum=client.get(url=links,headers=headers).text
    spectrum_html_pages=HTMLParser(spectrum)
    

    for hl in spectrum_html_pages.css('h2 > a'):
    
            l=hl.attributes['href']
            h=hl.text(strip=True)

            print(f'links: {l} headlines: {h}')

result.png


Text translated by DeepL



0 comments