Answer the question
In order to leave comments, you need to log in
I can't parse all values, why?
import requests
from fake_useragent import UserAgent
import json
ua = UserAgent()
def collect_data():
resource = requests.get(
url='https://market.csgo.com/api/v2/prices/RUB.json',
headers={'user-agent': f'{ua.random}'}
)
with open('tm.json','w') as file:
json.dump(resource.json(), file, indent=4, ensure_ascii=False)
def main():
collect_data()
if __name__ == '__main__':
main()
Answer the question
In order to leave comments, you need to log in
The error is easy to google:
with open('tm.json','w',encoding='utf-8') as file:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question