import asyncio
import aiohttp
from selectolax.parser import HTMLParserheaders={'user-agent': 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_5 rv:3.0; sl-SI) AppleWebKit/534.49.1 (KHTML, like Gecko) Version/4.0.1 Safari/534.49.1'}
async def parsing_page():
async with aiohttp.ClientSession() as session:
for index in range(2,6):
technobezz=await page.text()
technobezz_html=HTMLParser(technobezz)
for get_hl in technobezz_html.css('h1.mb-2.cate > a'):
h=get_hl.text(strip=True)
l=get_hl.attributes['href']
print(f'headlines: {h} links: {l}') async with session.get(f'https://www.technobezz.com/best/category/best-product/best-laptops/?page={index}',headers=headers) as page:asyncio.run(parsing_page())