Skip to content

Instantly share code, notes, and snippets.

@MayankFawkes
Created February 21, 2020 11:25
Show Gist options
  • Select an option

  • Save MayankFawkes/ce6b99f547186ab73ffe70b3277094a8 to your computer and use it in GitHub Desktop.

Select an option

Save MayankFawkes/ce6b99f547186ab73ffe70b3277094a8 to your computer and use it in GitHub Desktop.
import requests,re
pinid="116671446577537458"
html=requests.get("https://www.pinterest.com/pin/{}/".format(pinid)).text
ok=str(re.findall('<script id="initial-state" type="application/json">(.*?)</script>',html)[0])
data=["https://i.pinimg.com/originals/"+n for n in re.findall('"url":"https://i.pinimg.com/originals/(.*?)"',ok)][0]
print(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment