Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

183
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda