Subj : Re: Error message To : Charles Pierson From : Wilfred van Velzen Date : Fri Feb 05 2021 23:02:01 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 (), not a constant in this function definition. CP> try: CP> r = requests.get() 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: ') CP> print(e)print('Starting scraping') CP> hackernews_rss() Here where you call it you can give the constant to the function, like: hackernews_rss('https://news.ycombinator.com/rss') CP> print('Finished scraping') CP> Any idea what I flubbed? Bye, Wilfred. --- FMail-lnx64 2.1.0.18-B20170815 * Origin: FMail development HQ (2:280/464) .