Python Forum

Full Version: ReGex With Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Look at the source there is a list,as posted use [0] to get in.
['nodes'][0]['text']
(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?

(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']

Snippsat, i want to thank you very much for your help. Can I collaborate with the forum answering questions?.

Thanks again!.  Big Grin
Quote:Can I collaborate with the forum answering questions?

Sure, that is what the forum is for  Smile .
Pages: 1 2 3 4