При помощи selenium:
from selenium import webdriver
url='https://vk.com/kostya__wolf?z=photo107790602_343297825%2Falbum107790602_00%2Frev'
xpath='//a[@id="pv_open_original"]'
browser = webdriver.Firefox()
browser.get(url)
print browser.find_element_by_xpath(xpath).get_attribute('href')
browser.quit()
При помощи requests и lxml:
import requests
import json
import lxml.html
url='https://vk.com/kostya__wolf?z=photo107790602_343297825%2Falbum107790602_00'
r=requests.get(url)
doc=lxml.html.fromstring(r.text)
search_string=url[url.find('photo'):url.find('%2F')]
xpath='//a[contains(@href, "%s")]' % search_string
src=doc.xpath(xpath)[0].get('onclick')
d = json.loads(src[src.find('{'):src.find('}}')+len('}}')])
src=d['temp']['base']+d['temp']['z_'][0]+'.jpg'
print src