검색 기능 구현중 검색 기반 데이터가 필요해 스팀의 모든 게임을 크롤링해왔다.

총 7만여개의 데이터를 페이지당 표시하는 데이터수 25로 나누어 반올림해 최대 페이지수를 구했다.
url_for_page = 'https://store.steampowered.com/search/?ignore_preferences=1&page=1'
response_for_page = requests.get(url_for_page)
source_for_page = response_for_page.text
soup_for_page = BeautifulSoup(source_for_page, 'html.parser')
maximum_page_tag = soup_for_page.select_one('div.search_pagination_left').contents[0].strip()#총 게임수가 있는 tag
split_tag = maximum_page_tag.split('-')#'-'를 기준으로 나눔
game_per_page = split_tag[1].split('of')[0].strip()#'/'기준으로 나눔
maximum_game = split_tag[1].split('of')[1].strip()
max_page = math.ceil(int(maximum_game)/int(game_per_page))#반올림
whole_info = []
whole_source = []
for game in games:
if game.select_one('div > div > div.search_discount > span') != None:#할인중인 게임에만 있는 tag
game_title = 'not found'
game_link = 'not found'
game_original_price = 'not found'
game_img = 'not found'#해당게임은 이미 db에 있으므로 저장하지않는다.
else:
game_title = game.select_one('div > div > span.title').text
game_original_price = game.select_one('div > div > div.search_price').text.replace('₩', '',1).strip().replace(',','')
game_link = game['href']
game_img = game.select_one('div > img').get('src')
whole_info.append(game_link, game_img, game_title, game_original_price)#필요한 값만 배열에 추가
for s in db.info.find({"original_price_usd":{"$exists":True}}):