import requests
from bs4 import BeautifulSoup
import json

def get_pic_urls():
    urllist = []
    for page in range(38):
        url = "http://unsplash.com/page/"+ str(page+1)
        request = requests.get(url)
        posts = BeautifulSoup(request.text)
        for post in posts.find_all(class_="photo_div"):
            urllist.append(post.a["href"])
    with open("urls.js", "w") as js_file:
        json.dump({"url":urllist}, js_file, indent=2)

if __name__ == '__main__':
    get_pic_urls()

b57df4a70de39f834564ae15d3311efd927b097c
<mask token>

<mask token>


def get_pic_urls():
    urllist = []
    for page in range(38):
        url = 'http://unsplash.com/page/' + str(page + 1)
        request = requests.get(url)
        posts = BeautifulSoup(request.text)
        for post in posts.find_all(class_='photo_div'):
            urllist.append(post.a['href'])
    with open('urls.js', 'w') as js_file:
        json.dump({'url': urllist}, js_file, indent=2)


<mask token>

<mask token>


def get_pic_urls():
    urllist = []
    for page in range(38):
        url = 'http://unsplash.com/page/' + str(page + 1)
        request = requests.get(url)
        posts = BeautifulSoup(request.text)
        for post in posts.find_all(class_='photo_div'):
            urllist.append(post.a['href'])
    with open('urls.js', 'w') as js_file:
        json.dump({'url': urllist}, js_file, indent=2)


if __name__ == '__main__':
    get_pic_urls()

import requests
from bs4 import BeautifulSoup
import json


def get_pic_urls():
    urllist = []
    for page in range(38):
        url = 'http://unsplash.com/page/' + str(page + 1)
        request = requests.get(url)
        posts = BeautifulSoup(request.text)
        for post in posts.find_all(class_='photo_div'):
            urllist.append(post.a['href'])
    with open('urls.js', 'w') as js_file:
        json.dump({'url': urllist}, js_file, indent=2)


if __name__ == '__main__':
    get_pic_urls()

import requests
from bs4 import BeautifulSoup
import json

def get_pic_urls():
    urllist = []
    for page in range(38):
        url = "http://unsplash.com/page/"+ str(page+1)
        request = requests.get(url)
        posts = BeautifulSoup(request.text)
        for post in posts.find_all(class_="photo_div"):
            urllist.append(post.a["href"])
    with open("urls.js", "w") as js_file:
        json.dump({"url":urllist}, js_file, indent=2)

if __name__ == '__main__':
    get_pic_urls()
