Python Forum

Full Version: beautifulsoup :: possible to rssify content - of let us say 10 or 20 last records!?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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/org...ns_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
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.