M
M
Maxim Samonov2022-02-22 20:11:49
Python
Maxim Samonov, 2022-02-22 20:11:49

How to parse the name and price of a game on steam?

HERE IS MY CODE

from bs4 import BeautifulSoup as BS
import requests

soup1 = BS(requests.get('https://store.steampowered.com/specials/?l=russian#p=0&tab=TopSellers').text, 'html.parser')

skidki1 = soup1.findall(class='tab_item_name')

for item1 in skidki1:
    s = print(item1.text)

price = soup1.findall(class='discount_final_price')

for pr in price:
    p = print(pr.text)

hz = print(s , p)
for hg in hz:
    print(hg.text)


Is it possible to parse this so that the price of the game is displayed next to the name of the game, and if so, how?
PS My code gives errors.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
rPman, 2022-02-22
@rPman

Why so much haemorrhoids if there is an official api?
api.steampowered.com/ISteamApps/GetAppList/v0001 - a list of all applications
store.steampowered.com/api/appdetails?appids=43864... - information about the app appids, country code from which the request is made - cc
prices in cents [App Id ] > data > price_overview
(taken from here )
Documentation here , leaderboard here

N
Nikolai Savelyev, 2022-02-22
@AgentSmith

PS My code gives errors.

What errors does it give?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question