[ESP-ENG] Titulos y enlaces en codewall|| Titles and links in codewall

in #siteslast year (edited)


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

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'}
for index in range(1,5):
client=httpx.Client(headers=headers)
codewall=client.get(f'https://www.codewall.co.uk/page/{index}/').text
for hl in HTMLParser(codewall).css('h2.entry-title > a'):
print(f'headlines: {hl.text(strip=True)} links: {hl.attributes["href"]}')