create account

[ESP-ENG] Titulos y enlaces en lpeproject || Titles and links in lpeproject by pynomiems

View this thread on: hive.blogpeakd.comecency.com
· @pynomiems ·
$4.27
[ESP-ENG] Titulos y enlaces en lpeproject || Titles and links in lpeproject
<center>

![Preview.png](https://files.peakd.com/file/peakd-hive/pynomiems/AKYNLDQiya2oXm4LS88usYK1VAVqZyGqrkSzDJFWK8pNHv2DGfnoufmFyt8Xo8g.png)<center>Imagen diseñada con <a href="https://www.canva.com/">canva</a> || Image designed with <a href="https://www.canva.com/">canva</a></sub>
</center>

</center>

<div>

<div class="text-justify">

<pre>

import asyncio
import aiohttp
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'}

async def parsing_page():
    
    async with aiohttp.ClientSession() as session:

        for idx in range(1,6): 
            
            async with session.get(f'https://lpeproject.org/blog/page/{idx}/',headers=headers) as page:
                
                lpeproject=await page.text() 
                lpeproject_html=HTMLParser(lpeproject)
                 
                for hl in lpeproject_html.css('h2 > a'):

                    headlines=hl.text(strip=True)
                    links=hl.attributes['href']
    
                    print(f'headlines: {headlines} links: {links}')

asyncio.run(parsing_page())

</pre>

</div>

<center>

![result.png](https://files.peakd.com/file/peakd-hive/pynomiems/23swaAqtkjhvhxh5qrfjjQR1L114FtgviuMAgrwBLHWtfS3W8pdrwZXb1b1sqR53JhF3w.png)

![result II.png](https://files.peakd.com/file/peakd-hive/pynomiems/Eo1xoFLmZfeee4couSFdS5TSBNNBAktHgrfpaii8Qwm1N499DTfkbYwNmc76scSa9Mf.png)

</center>

---

<center>

## Text translated by <a href="https://www.deepl.com/es/translator">DeepL</a>

</center>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorpynomiems
permlinkesp-eng-titulos-y-enlaces-en-lpeproject-oror-titles-and-links-in-lpeproject
categoryhive-148441
json_metadata{"app":"peakd/2022.11.1","format":"markdown","tags":["development","blog"],"users":[],"image":["https://files.peakd.com/file/peakd-hive/pynomiems/AKYNLDQiya2oXm4LS88usYK1VAVqZyGqrkSzDJFWK8pNHv2DGfnoufmFyt8Xo8g.png","https://files.peakd.com/file/peakd-hive/pynomiems/23swaAqtkjhvhxh5qrfjjQR1L114FtgviuMAgrwBLHWtfS3W8pdrwZXb1b1sqR53JhF3w.png","https://files.peakd.com/file/peakd-hive/pynomiems/Eo1xoFLmZfeee4couSFdS5TSBNNBAktHgrfpaii8Qwm1N499DTfkbYwNmc76scSa9Mf.png"]}
created2022-11-21 03:23:12
last_update2022-11-21 03:23:12
depth0
children0
last_payout2022-11-28 03:23:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value4.269 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,629
author_reputation273,261,352,410,025
root_title"[ESP-ENG] Titulos y enlaces en lpeproject || Titles and links in lpeproject"
beneficiaries
0.
accountreward.app
weight10,000
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id118,495,212
net_rshares17,343,801,036,556
author_curate_reward""
vote details (31)