I want to add onto this program to save each crashPoint to a text file, with a new crash point being added onto a new line. I've attempted to do it from past work, but I can't seem to get it to work together.
#Imports
from bs4 import BeautifulSoup
from urllib import urlopen
import time
#Required Fields
pageCount = 1287528
#Loop
while(pageCount>0):
time.sleep(1)
html = urlopen('https://www.csgocrash.com/game/1/%s' % (pageCount)).read()
soup = BeautifulSoup(html, "html.parser")
try:
section = soup.find('div', {"class":"row panel radius"})
crashPoint = section.find("b", text="Crashed At: ").next_sibling.strip()
except:
continue
print(crashPoint[0:-1])
pageCount+=1
Could someone point out what I'm doing wrong and how to fix it?