У меня проблема, когда я могу соскрести данные с веб -сайта, используя Java Pathing. Я пытаюсь скрепить с трекера ракетной лиги.
Вот мой код: < /p>
import requests
import re
import json
import math
def rankGetter():
trackerLink = 'https://rocketleague.tracker.network/ro ... a/overview'
# now we have the tracker link we're going to scrape the website
# all the HTML of the site is now in result
result = requests.get(trackerLink)
# checker to make sure the user used the correct information
if result.status_code == 400:
print('profile not found')
else:
# Extract everything needed to render the current page. Data is stored as Json in the
# JavaScript variable: window.__INITIAL_STATE__={"route":{"path":"\u0 ... }};
json_string = re.search(r"window.__INITIAL_STATE__\s?=\s?(\{.*?\});", result.text).group(1)
# convert text string to structured json data
rocketleague = json.loads(json_string)
# Save structured json data to a text file that helps you orient yourself and pick
# the parts you are interested in.
with open('rocketleague_json_data.txt', 'w') as outfile:
outfile.write(json.dumps(rocketleague, indent=4, sort_keys=True))
< /code>
Ошибка - это текстовый документ, который делается больше не имеет ранг, которые я хочу. < /p>
"stats": {
"standardLeaderboardLeaders": {},
"standardLeaderboards": [],
"standardPlayers": {},
"standardTitles": {}
},
**"stats-v2": {
"segments": {},
"standardProfileMatches": {},
"standardProfileSummaries": {},
"standardProfiles": {},
"standardProfilesHistory": {},
"standardSessions": {},
"subscriptions": {}
},**
"titles": {
"currentTitle": {
"name": "Rocket League",
"platforms": [
< /code>
Ранги должны находиться под статистикой-V2, но, как вы можете увидеть, сейчас его пусто.
Что происходит и как это исправить? Я смог получить ряды в течение недели, но вдруг он перестал работать сегодня.
Подробнее здесь: https://stackoverflow.com/questions/672 ... s-and-json
(Python) Не удается соскрести данные из Rocket Tracker, используя RE, запросы и JSON ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как реализовать BYTETRACK TRACKER на модели TFlite для подсчета количества людей?
Anonymous » » в форуме Python - 0 Ответы
- 17 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Класс 'Pragmarx \ Tracker \ Vendor \ Laravel \ ServiceProvider' не найден
Anonymous » » в форуме Php - 0 Ответы
- 4 Просмотры
-
Последнее сообщение Anonymous
-