I recently started up FreshRSS in my docker environment. I was super excited about the web scraping feature.
Now that I’m setting it up, it looks like that it is able to scrape single web pages, but I am unable to figure out how to get it to crawl into the actual article to scrape the full content.
Is anyone aware of how to do this. For example, runescape.com/m=news/ This page has a list of articles with a thumbnail, title, category, date, and a short description of the article. Would it be possible for FreshRSS to crawl into the article link and scrape the contents within?
I haven’t tried it yet and it depends on an outside service, but maybe https://morss.it/ can help?
Note: it can be selfhosted
I didn’t know about morss.it. It’s amazing, thank you.
Thanks for that link! That site is able to pull the full article so it makes me think it is possible! I will try to adapt it to FreshRSS.
Thanks again!
It is definitely possible, as RSS readers like ReadYou can do it. Maybe try FreshRSS in conjuction with an RSS reader?
It can be done directly in FreshRSS and I’ve done it successfully with a few websites, though the process is fairly involved. Here’s a starting point, from the FreshRSS documentation:
https://freshrss.github.io/FreshRSS/en/users/11_website_scraping.html
This blog post (also linked in the FreshRSS docs above) proved extremely useful as an example on how to get started:
https://danq.me/2022/09/27/freshrss-xpath/
Good luck!
Before you go reading all that, out of curiosity I looked around the RuneScape site and found the News RSS feed here:
https://secure.runescape.com/m=news/latest_news.rss
That feed contains only titles, thumbnails and a very small preview of each article. However, with FreshRSS you don’t need to do scraping/crawling at all to get full articles from limited RSS feeds like this one. Here’s what you do:
- Subscribe to the RSS feed in FreshRSS as you normally would.
- Go to Subscription Management and find the settings for the RuneScape feed.
- In the Advanced section of the feed settings, find the item called “Article CSS selector on original website”, and write
.c-news-article__content
in that text box. You can click on the button next to the text box to preview the full article that FreshRSS will retrieve. - Click Submit to save the changes, and then go to the bottom of the feed settings and click Reload articles so that FreshRSS populates the feed with a few full articles.
That should do it. The CSS selector essentially tells FreshRSS which section of the full article’s HTML/CSS is the body of the article, which FreshRSS then uses to populate the body of the RSS feed.
Thank you so much! This worked out fantastically and it also looks great in the feed. I don’t know how you figured this stuff out but I need to get learned up on this!
Thanks a ton for those links