def scrape_function():
try:
#8 spaces
some_code_to_scrape
except:
pass
some_variable = True
while some_variable == True:
scrape_function()
Be careful w/ that code btw. If using, you're going to want to put a delay on the loop to ensure you're not unintentionally DOSing the site.
time.sleep(1)
the 1 inside the function signals to stop for one second before moving on. This will mean I access a page slightly less frequently than once per second because my VPS needs to send data to my postgres server and fetch HTML