Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import time
import requests
destination = '/Volumes/UNTITLED/wimoveis/paginas/'
base_url = ''
num_pages = 1557 # number of results pages
for i in range(1, num_pages):
print('page', i)
query_url = base_url + 'apartamentos-venda-distrito-federal-goias-pagina-{}.html'.format(i)
response = requests.get(query_url)
if response.status_code == 200:
# save source code of the page
with open(destination + 'pagina_{}.html'.format(i), mode = 'w') as f:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment