import pywikibot

repo=pywikibot.Site('wikidata','wikidata').data_repository()
wditem=pywikibot.ItemPage(repo,'Q317007')
wditem.get()
print('Q: %s-%s\n\n' % (type(wditem),wditem))
birthdateclaim=wditem.claims.get('P569')[0]
print('\n\nResult: %d/%d/%d %s' % (birthdateclaim.year,birthdateclaim.month,birthdateclaim.day, birthdateclaim.precision))
print(birthdateclaim.qualifiers)
for qualifier in birthdateclaim.qualifiers:
    print('Q: %s' % qualifier)
if ('P1480' in birthdateclaim.qualifiers):
    print('Ja, zit erin')
    qualifier=birthdateclaim.qualifiers['P1480'][0]
    print('QQ: %s-%s\n\n' % (type(qualifier),qualifier))
    content=qualifier.getTarget()
    print(dir(content))
    print(content.title)
#    weitem=pywikibot.ItemPage(repo,content.title)
#    weitem.get()
#    print('QQQ: %s-%s\n\n' % (type(wditem),wditem))
#    print('\n\nResult: %d/%d/%d' % (content.year,content.month,content.day))
    
    
#zo kon ik wel achterhalen wat het was:    
#for x in dir(birthdateclaim):
#    print(x)
Q: <class 'pywikibot.page.ItemPage'>-[[wikidata:Q317007]]


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-11-763e30702859> in <module>()
      6 print('Q: %s-%s\n\n' % (type(wditem),wditem))
      7 birthdateclaim=wditem.claims.get('P569')[0]
----> 8 print('\n\nResult: %d/%d/%d %s' % (birthdateclaim.year,birthdateclaim.month,birthdateclaim.day, birthdateclaim.precision))
      9 print(birthdateclaim.qualifiers)
     10 for qualifier in birthdateclaim.qualifiers:

AttributeError: 'Claim' object has no attribute 'year'