Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ReGex With Python
#32
(Oct-22-2016, 05:58 PM)snippsat Wrote: Look at the source there is a list,as posted use [0] to get in.
['nodes'][0]['text']

Oh, i will try this:
    try:
        while count <= len(data['entry_data']['PostPage'][0]['media']['comments']['nodes'][count]['text']):
            try:
                print(data['entry_data']['PostPage'][0]['media']['comments']['nodes'][count]['text'])
                count = count + 1
            except:
                pass
    except:
        pass
Output:
All comments  **biggrin**
But, my question, If I do not put the try, I get an error, there may be a problem in the future?

Reply


Messages In This Thread
ReGex With Python - by Kalet - Oct-21-2016, 08:29 PM
RE: ReGex With Python - by nilamo - Oct-21-2016, 08:43 PM
RE: ReGex With Python - by Kalet - Oct-21-2016, 08:52 PM
RE: ReGex With Python - by nilamo - Oct-21-2016, 08:59 PM
RE: ReGex With Python - by Kalet - Oct-21-2016, 09:05 PM
RE: ReGex With Python - by nilamo - Oct-21-2016, 09:19 PM
RE: ReGex With Python - by Kalet - Oct-21-2016, 09:24 PM
RE: ReGex With Python - by Ofnuts - Oct-21-2016, 10:00 PM
RE: ReGex With Python - by Kalet - Oct-21-2016, 10:09 PM
RE: ReGex With Python - by snippsat - Oct-21-2016, 10:37 PM
RE: ReGex With Python - by Kalet - Oct-21-2016, 10:56 PM
RE: ReGex With Python - by snippsat - Oct-21-2016, 11:13 PM
RE: ReGex With Python - by Kalet - Oct-21-2016, 11:26 PM
RE: ReGex With Python - by snippsat - Oct-21-2016, 11:31 PM
RE: ReGex With Python - by Kalet - Oct-21-2016, 11:48 PM
RE: ReGex With Python - by snippsat - Oct-21-2016, 11:59 PM
RE: ReGex With Python - by Kalet - Oct-22-2016, 12:05 AM
RE: ReGex With Python - by snippsat - Oct-22-2016, 12:07 AM
RE: ReGex With Python - by Kalet - Oct-22-2016, 12:15 AM
RE: ReGex With Python - by snippsat - Oct-22-2016, 12:22 AM
RE: ReGex With Python - by Kalet - Oct-22-2016, 12:31 AM
RE: ReGex With Python - by snippsat - Oct-22-2016, 12:56 AM
RE: ReGex With Python - by Kalet - Oct-22-2016, 01:04 AM
RE: ReGex With Python - by snippsat - Oct-22-2016, 01:15 AM
RE: ReGex With Python - by Kalet - Oct-22-2016, 01:25 AM
RE: ReGex With Python - by snippsat - Oct-22-2016, 01:46 AM
RE: ReGex With Python - by Kalet - Oct-22-2016, 03:13 AM
RE: ReGex With Python - by Kalet - Oct-22-2016, 04:18 PM
RE: ReGex With Python - by snippsat - Oct-22-2016, 04:46 PM
RE: ReGex With Python - by Kalet - Oct-22-2016, 05:39 PM
RE: ReGex With Python - by snippsat - Oct-22-2016, 05:58 PM
RE: ReGex With Python - by Kalet - Oct-22-2016, 06:36 PM
RE: ReGex With Python - by Kalet - Oct-23-2016, 10:21 PM
RE: ReGex With Python - by sparkz_alot - Oct-24-2016, 12:23 AM

Forum Jump:

User Panel Messages

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