Fidonet Portal






From: Charles Pierson (1:106/127)
To: All
Date: Fri, 05.02.21 14:35
Error message
I'm trying to make an RSS scraper to pull articles from RSS feeds and export
them to text files, to be used either in my BBS bulletins or message areas

I found a web page that supposedly does exactly this, however using the code
and testing I get the Folliwing error:


python scraping.py
File "scraping.py", line 5
def
hackernews_rss('https://news.ycombinator.com/rss'):
^
SyntaxError: invalid
syntax



The code is:

# scraping function
def hackernews_rss('https://news.ycombinator.com/rss'):
try:
r = requests.get(Wink
return print('The scraping job succeeded: ', r.status_code)
except Exception as e:
print('The scraping job failed. See exception: 'Wink
print(e)print('Starting scraping'Wink
hackernews_rss(Wink
print('Finished scraping'Wink


Any idea what I flubbed?

Thanks

--- Mystic BBS v1.12 A46 2020/08/26 (Raspberry Pi/32)
* Origin: theoasisbbs.ddns.net:1357 (1:106/127)

From: Wilfred van Velzen (2:280/464)
To: -Havok (1:103/705)
Date: Fri, 05.02.21 23:02
Re: Error message
Hi Charles,

On 2021-02-05 14:35:27, you wrote to All:

CP> I'm trying to make an RSS scraper to pull articles from RSS feeds and
CP> export them to text files, to be used either in my BBS bulletins or
CP> message areas

CP> I found a web page that supposedly does exactly this, however using the
CP> code and testing I get the Folliwing error:


CP> python scraping.py
CP> File "scraping.py", line 5
CP> def
CP> hackernews_rss('https://news.ycombinator.com/rss'):

CP> ^
CP> SyntaxError: invalid
CP> syntax



CP> The code is:

CP> # scraping function
CP> def hackernews_rss('https://news.ycombinator.com/rss'):

There should be a variable there between the (Wink, not a constant in this
function definition.

CP> try:
CP> r = requests.get(Wink

Is 'requests' defined of set somewhere? I don't see it.

CP> return print('The scraping job succeeded: ', r.status_code)
CP> except Exception as e:
CP> print('The scraping job failed. See exception: 'Wink
CP> print(e)print('Starting scraping'Wink

CP> hackernews_rss(Wink

Here where you call it you can give the constant to the function, like:

hackernews_rss('https://news.ycombinator.com/rss'Wink

CP> print('Finished scraping'Wink


CP> Any idea what I flubbed?


Bye, Wilfred.

--- FMail-lnx64 2.1.0.18-B20170815
* Origin: FMail development HQ (2:280/464)

ABOUT

This forum contains echomail areas hosted on Nightmare BBS You can browse local echomail areas, italian fidonet areas and a selection of international fidonet areas, reading messages posted by users in Nightmare BBS or even other BBSs all over the world. You can find file areas too (functional to fidonet technology). You can browse echomail areas and download files with no registration, but if you want to write messages in echomail areas, or use fidonet netmail (private messages with fidomet technology), you have to register. Only a minimal set of data is required, functional to echomail and netmail usage (name, password, email); a registration and login with facebook is provided too, to allow easy registration. If you won't follow rules (each echomail areas has its own, regularly posted in the echomail), your account may be suspended;

CONTACT