Python Forum
Problem with retrieving and parsing from webpage.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with retrieving and parsing from webpage.
#11
(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.
Reply
#12
(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.
Reply
#13
If you put print(data) below the request.get call, is 'data' printed to the terminal?
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#14
(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.
Reply
#15
Test also to print(type(data)) and post what it prints.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#16
(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'>
Reply
#17
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.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#18
(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
Reply
#19
What is that library? Can you point a link to it?
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#20
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  KeyError while retrieving ESPN data john317ab 2 874 Nov-29-2023, 09:07 PM
Last Post: john317ab
  .get() not retrieving value? Sedos101 2 624 Aug-25-2023, 11:48 AM
Last Post: deanhystad
  [Solved] Retrieving a pdf from sqlite3 BigMan 4 2,437 Mar-12-2022, 01:56 PM
Last Post: deanhystad
  Retrieving a column from a data set using a function Bayle 6 2,430 Oct-06-2021, 08:52 PM
Last Post: Bayle
  Retrieving Cookies whois1230 2 2,235 Nov-21-2020, 12:01 PM
Last Post: snippsat
  Problem: Retrieving Form data PythonDev 3 3,153 Oct-16-2020, 02:09 AM
Last Post: PythonDev
  Retrieving dictionary keys within with another dictionay bazcurtis 8 2,915 Oct-29-2019, 10:06 PM
Last Post: bazcurtis
  Retrieving items from JSON bazcurtis 12 5,179 Oct-27-2019, 05:18 PM
Last Post: bazcurtis
  Trouble retrieving dictionary from mysql.connector cursor swechsler 2 3,118 Sep-17-2019, 05:21 PM
Last Post: swechsler
  retrieving pvalue from statsmodels results Staph 4 3,094 Jul-18-2019, 03:27 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020