Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

185
Visualizações
javascript to python dictionary help needed

I need some help extracting javascript data to my python programme.

    soup = BeautifulSoup(wm, "html.parser")
    scripts = soup.findAll('script')
    s = scripts[:50]
    print(s)

Using the above i am getting the below output - again within a javascript

I am looking to extract the data below from this - any help would be much appreciated!

In essence i am looking to get the items.push> saved as a python dictionary.



        var items = [];

    


        items.push({

            'item_id': '196388',

            'item_name': 'Rolex Submariner 116610 LN',

            'item_brand': 'Rolex',

            'item_collection': 'Submariner',

            'item_variant': '116610 LN',

            'item_category': 'watch',

            'price': '12500',

            'currency': 'GBP',

            'quantity': '1',

            'item_material_case': 'Steel',

            'item_material_strap': 'Steel (Oyster)',

            'item_dial': 'Black',

            'item_size': '40',

            'item_box': 'True',

            'item_papers': 'True',

            'item_special_edition': 'False',

            'item_available': 'instock',

            'item_sellable': 'sellable',

            'item_year': '2013'



            });

        


        items.push({

            'item_id': '211954',

            'item_name': 'Rolex Submariner 116610 LN',

            'item_brand': 'Rolex',

            'item_collection': 'Submariner',

            'item_variant': '116610 LN',

            'item_category': 'watch',

            'price': '12400',

            'currency': 'GBP',

            'quantity': '1',

            'item_material_case': 'Steel',

            'item_material_strap': 'Steel (Oyster)',

            'item_dial': 'Black',

            'item_size': '40',

            'item_box': 'True',

            'item_papers': 'True',

            'item_special_edition': 'False',

            'item_available': 'preorder',

            'item_sellable': 'sellable',

            'item_year': '2012'



            });

        
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Seeing your data I think you fetch them from an API, so given the endpoint you can get the dict using this:

import requests
response = requests.get(endpoint)
json = response.json() // your dict
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda