home bbs files messages ]

Just a sample of the Echomail archive

Cooperative anarchy at its finest, still active today. Darkrealms is the Zone 1 Hub.

   PYTHON      Support for the Python language      96 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 66 of 96   
   Wilfred van Velzen to Charles Pierson   
   Re: Error message   
   05 Feb 21 23:02:01   
   
   TID: FMail-lnx64 2.1.0.18-B20170815   
   RFC-X-No-Archive: Yes   
   TZUTC: 0100   
   CHRS: UTF-8 2   
   PID: GED+LNX 1.1.5-b20161221   
   MSGID: 2:280/464 601dc146   
   REPLY: 1:106/127 031409d9   
   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)   
   SEEN-BY: 1/123 90/1 105/81 120/340 123/131 124/5016 203/0 221/0 226/30   
   SEEN-BY: 227/114 702 229/424 426 616 664 1016 1017 240/5411 5824 5832   
   SEEN-BY: 240/5853 249/206 317 400 280/464 5003 288/100 292/8125 322/757   
   SEEN-BY: 342/200 423/120 712/848 770/1 2452/250   
   PATH: 280/464 240/5832 229/426   
      

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca