M
M
Maxim Mikhalko2022-01-04 14:47:16
Parsing
Maxim Mikhalko, 2022-01-04 14:47:16

The parser on STEAM does not work. I can’t find the component, I can’t understand. What is the problem?

from bs4 import BeautifulSoup
import requests

headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.19041'}

URL = 'https://store.steampowered.com/search/?term=vr'
responce = requests.get(URL)
soup = BeautifulSoup(responce.text, 'lxml')

games = soup.find_all('a',class_='search_result_row ds_collapse_flag  app_impression_tracked')
for i in range(10):
    print(games)
for title in games:
    title = soup.find('span',class_='title')
    print(title.text)


just outputs empty lists.
I rechecked the classes, everything is correct, but why does it display empty lists

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kot2566, 2022-01-04
@kot2566

Open through Code page.

view-source:https://store.steampowered.com/search/?term=vr

There doesn't seem to be the last class ('app_impression_tracked')
61d448ee6cb26385027961.png
So maybe it will work like this, if not something else:
games = soup.find_all('a',class_='search_result_row ds_collapse_flag')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question