Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!