Answer the question
In order to leave comments, you need to log in
Parsing the price of an item on the Steam marketplace?
Hey! How to parse the price of goods on the trading platform.
The user enters a link to an item and the program displays the price of this item every ten minutes.
I tried to do it myself, without moms and dads, but it didn’t work out that way. Here is my code:
import requests
from bs4 import BeautifulSoup as bs
url = input()
r = requests.get(url).text
soup = bs(r,'html.parser')
search = soup.select("#market_commodity_forsale > span.market_commodity_orders_header_promote:nth-child(3)")
print(search.text)
Answer the question
In order to leave comments, you need to log in
Steam prices are loaded from the API, using such links, in the JSON response, which contains the keys lowest_sell_order
and the highest_buy_order
ones you need. The product ID is stored in another JSON, which is on the page at the link you wrote in the question.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question