D
D
daloshka2019-11-07 21:40:55
Python
daloshka, 2019-11-07 21:40:55

How to parse the price of an item on Steam?

Please help, I've been suffering for a week now. How to parse the 'Starting Price' of a sale. When trying to parse, python outputs an empty string.

import requests
from bs4 import BeautifulSoup as bs

url = 'https://steamcommunity.com/market/listings/730/CS20%20Case'    # Ссылка на кейс
r = requests.get(url).text      # Запрос на получение html
print(r) # Вывод html
soup = bs(r,'html.parser') 
search = soup.find('div', class_='market_commodity_order_summary')
print(search.text)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
daloshka, 2019-11-08
@daloshka

Information can be obtained through the Network

Y
y0u, 2019-11-07
@y0u

I guess it's like this:

soup.select("#market_commodity_forsale > span.market_commodity_orders_header_promote:nth-child(3)");
print(search.text)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question