Information comes from the server in this form:
{ 'date': 1539251604, 'from_id': 511076166, 'id': 13135, 'out': 1, 'peer_id': 2000000007, 'text': '', 'conversation_message_id': 6231, 'fwd_messages': [], 'important': False, 'random_id': 521048654, 'attachments': [ { 'type': 'photo', 'photo': { 'id': 456239156, 'album_id': -3, 'owner_id': 511076166, 'sizes': [ { 'type': 's', 'url': 'https://pp.userapi.com/c851016/v851016735/1fed3/WokhTUD_2Mc.jpg', 'width': 1, 'height': 1 }, { 'type': 'm', 'url': 'https://pp.userapi.com/c851016/v851016735/1fed4/5Gqb9dlJIOE.jpg', 'width': 1, 'height': 1 }, { 'type': 'x', 'url': 'https://pp.userapi.com/c851016/v851016735/1fed5/nxejisifcP8.jpg', 'width': 1, 'height': 1 }, { 'type': 'o', 'url': 'https://pp.userapi.com/c851016/v851016735/1fed6/WKu01Esn_s0.jpg', 'width': 1, 'height': 1 }, { 'type': 'p', 'url': 'https://pp.userapi.com/c851016/v851016735/1fed7/Ts8l1jwE7ys.jpg', 'width': 1, 'height': 1 }, { 'type': 'q', 'url': 'https://pp.userapi.com/c851016/v851016735/1fed8/WlxWkF4gdl4.jpg', 'width': 1, 'height': 1 }, { 'type': 'r', 'url': 'https://pp.userapi.com/c851016/v851016735/1fed9/1PI5cwmKqr4.jpg', 'width': 1, 'height': 1 } ], 'text': '', 'date': 1539251598, 'access_key': 'af125b9950b452218a' } }, { 'type': 'photo', 'photo': { 'id': 456239157, 'album_id': -3, 'owner_id': 511076166, 'sizes': [ { 'type': 's', 'url': 'https://pp.userapi.com/c851016/v851016735/1feda/Kkx3EKlIoqs.jpg', 'width': 1, 'height': 1 }, { 'type': 'm', 'url': 'https://pp.userapi.com/c851016/v851016735/1fedb/JrzeNLaY0nQ.jpg', 'width': 1, 'height': 1 }, { 'type': 'x', 'url': 'https://pp.userapi.com/c851016/v851016735/1fedc/sn2sNSL-ajo.jpg', 'width': 1, 'height': 1 }, { 'type': 'o', 'url': 'https://pp.userapi.com/c851016/v851016735/1fedd/mt1Rj3RPDCo.jpg', 'width': 1, 'height': 1 }, { 'type': 'p', 'url': 'https://pp.userapi.com/c851016/v851016735/1fede/2cViz9gNm7c.jpg', 'width': 1, 'height': 1 }, { 'type': 'q', 'url': 'https://pp.userapi.com/c851016/v851016735/1fedf/n0VGo-Askwk.jpg', 'width': 1, 'height': 1 }, { 'type': 'r', 'url': 'https://pp.userapi.com/c851016/v851016735/1fee0/f6UwVoiPYls.jpg', 'width': 1, 'height': 1 } ], 'text': '', 'date': 1539251602, 'access_key': 'ea1302d738f5092d1c' } } ], 'is_hidden': False } I need to get from this entire text all the links that come after the 'type': 'r', 'url': (there are 2 of them here). The question is how to implement it?
for x in словарь['attachments']and insidefor size in x['sizes']plus minor additional checks - andreymalx['photo']['sizes']. Although you have to understand all this yourself if you have read at least one python tutorial - andreymal