Python Forum

Full Version: Problem with retrieving and parsing from webpage.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
(May-16-2018, 04:11 PM)Geluidsgoeroe Wrote: [ -> ]That's why I'm trying to figure out how to get text in there from a webpage
Take a look at Web-Scraping part-1.
(May-16-2018, 04:18 PM)snippsat Wrote: [ -> ]
(May-16-2018, 04:11 PM)Geluidsgoeroe Wrote: [ -> ]That's why I'm trying to figure out how to get text in there from a webpage
Take a look at Web-Scraping part-1.

Thanks, but that part has been figured out already.
I have a working script that retrieves the text, and I have a working script that displays RDS.

What I'm looking for now is how to put the output of the first one, into the second one.
If you put print(data) below the request.get call, is 'data' printed to the terminal?
(May-16-2018, 04:37 PM)wavic Wrote: [ -> ]If you put print(data) below the request.get call, is 'data' printed to the terminal?

Just now tested... Yes it is.
Test also to print(type(data)) and post what it prints.
(May-16-2018, 05:20 PM)wavic Wrote: [ -> ]Test also to print(type(data)) and post what it prints.

Instead of displaying the actual data from the webpage, it now keeps printing (while loop) this to the terminal:
<type 'str'>
Good!
So, you give to setRDSbuffer a plain string and it works but if you give it an object which is also a string doesn't work? That no make sense at all. Both are strings.
(May-16-2018, 05:44 PM)wavic Wrote: [ -> ]Good!
So, you give to setRDSbuffer a plain string and it works but if you give it an object which is also a string doesn't work? That no make sense at all. Both are strings.

Very informative. I'm learning new things here. Thanks.
But. Erm... Wait... Looking more closely... The problem seems to originate in another (not necessarily customizable) script.
Traceback (most recent call last):
  File "/home/pi/radio/radio.py", line 41, in <module>
    radio.setRDSbuffer( data)
  File "/home/pi/radio/Adafruit_Si4713.py", line 749, in setRDSbuffer
    bufferArray[i] = char
IndexError: list assignment index out of range
Any idea what that last line could mean?
Quote:IndexError: list assignment index out of range
What is that library? Can you point a link to it?
(May-16-2018, 06:20 PM)wavic Wrote: [ -> ]What is that library? Can you point a link to it?
It can be found over here, if this is what you mean.
Pages: 1 2 3