Issue
I want to get url from faceit match For example faceit match
I need to get this tab tab
But when I am trying to get by BS4, it doesn`t show any elements BECAUSE It's being loaded dynamically. How to make python get this 10 tabs, then I will just extract steam urls. Help me please i want to get this
Solution
As page is loading dynamically, you need to inspect the network tab to see where the data comes from. I'm not sure what sort of data you are after, but you can, for example, do this (after inspecting Network tab and determine which call is pulling your relevant data):
import requests
import pandas as pd
r = requests.get('https://api.faceit.com/match/v2/match/1-b0384d14-9625-49ca-8979-fa7a816d8c3c') ## one of the network calls, visible in Network tab, Dev tools
dfs = pd.json_normalize(r.json()['payload']['voting']['map']['entities'])
dfs
This will print out:
class_name game_map_id guid image_lg image_sm name
0 de_dust2 de_dust2 de_dust2 https://assets.faceit-cdn.net/third_party/game... https://assets.faceit-cdn.net/third_party/game... Dust2
1 de_mirage de_mirage de_mirage https://assets.faceit-cdn.net/third_party/game... https://assets.faceit-cdn.net/third_party/game... Mirage
2 de_nuke de_nuke de_nuke https://assets.faceit-cdn.net/third_party/game... https://assets.faceit-cdn.net/third_party/game... Nuke
3 de_overpass de_overpass de_overpass https://assets.faceit-cdn.net/third_party/game... https://assets.faceit-cdn.net/third_party/game... Overpass
4 de_train de_train de_train https://assets.faceit-cdn.net/third_party/game... https://assets.faceit-cdn.net/third_party/game... Train
5 de_inferno de_inferno de_inferno https://assets.faceit-cdn.net/third_party/game... https://assets.faceit-cdn.net/third_party/game... Inferno
6 de_vertigo de_vertigo de_vertigo https://assets.faceit-cdn.net/third_party/game... https://assets.faceit-cdn.net/third_party/game... Vertigo
7 de_ancient de_ancient de_ancient https://assets.faceit-cdn.net/third_party/game... https://assets.faceit-cdn.net/third_party/game... Ancient
You can further inspect the json response and see which data is relevant to you.
Answered By - platipus_on_fire
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.