Python Forum
beautifulsoup :: possible to rssify content - of let us say 10 or 20 last records!? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: beautifulsoup :: possible to rssify content - of let us say 10 or 20 last records!? (/thread-24398.html)



beautifulsoup :: possible to rssify content - of let us say 10 or 20 last records!? - apollo - Feb-12-2020

hello dear python-experts,


i am fairly new to python know a little the parser and have heard bout beautiful soup

i want to gather some information from this site:

https://europa.eu/youth/volunteering/organisations_en#open


is this possible to rssify content - of let us say 10 or 20 last records!?

i need an approach..

love to hear from you

apollo


RE: beautifulsoup :: possible to rssify content - of let us say 10 or 20 last records!? - snippsat - Feb-12-2020

Look at Web-Scraping part-1 and part-2
Then you should try yourself,here a start with some hints.
import requests
from bs4 import BeautifulSoup

url = 'https://europa.eu/youth/volunteering/organisations_en#open'
response = requests.get(url)
soup = BeautifulSoup(response.content, 'lxml')
print(soup.find('title').text)
block = soup.find('div', class_="eyp-card block-is-flex")
Test usage,site have blocks with info,here some on first block.
European Youth Portal
>>> block.a
<a href="/youth/volunteering/organisation/48592_en" target="_blank">"Academy for Peace and Development" Union</a>
>>> block.a.text
'"Academy for Peace and Development" Union'

>>> block.select_one('div > div > p:nth-child(9)')
<p><strong>PIC:</strong> 948417016</p>
>>> block.select_one('div > div > p:nth-child(9)').text
'PIC: 948417016' 
apollo Wrote:is this possible to rssify content - of let us say 10 or 20 last records!?
RSS is a kind of XML very close,so can use parsed content or HTML tag to make it.