SShortSingh.
Back to feed

Python tutorial shows how to extract and track product prices from JSON-LD data

0
·59 views

A developer tutorial published on DEV Community demonstrates how to monitor product price and stock changes using JSON-LD structured data embedded in web pages. The guide explains that many e-commerce product pages include machine-readable Schema.org markup, which can be parsed programmatically in Python. The tutorial covers extracting key fields such as price, currency, availability, and offer count from both single offers and aggregate offer blocks. It also walks through building a diff mechanism to detect changes between successive data snapshots, such as price drops or stock status updates. Unit tests included in the article validate the parsing logic across various edge cases, including malformed JSON and non-standard data formats.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

OpenAI Publishes Analysis of AI's Effect on Freelance Work

OpenAI has released a report examining how artificial intelligence is affecting freelance work. The post was shared on Hacker News, where it drew modest attention with 7 points and 2 comments. The available material consists of the link and discussion metadata rather than a detailed excerpt of the report's findings. Readers interested in the specific conclusions will need to consult the original OpenAI publication.

0
ProgrammingHacker News ·

Synaptics patent claims halt development of DisplayLink drivers

Development of Linux drivers for DisplayLink hardware has reportedly been stopped due to patent claims from Synaptics. The information comes from an LWN.net article shared on Hacker News, which had gained 10 points and no comments at the time of capture. The source material provided is limited to the article link and metadata, so the specific patents, the scope of the claims, and the parties' positions are not described here. Readers should consult the original LWN article for full details on the dispute.

0
ProgrammingHacker News ·

Chrome and partners release Modern Web Guidance 1.0 to steer coding agents toward native browser APIs

Chrome, in collaboration with Firefox, MDN, and Edge, has released version 1.0 of Modern Web Guidance, a set of over 200 open-source implementation guides for coding agents. The guides cover native browser features such as CSS highlights, dialog backdrops, and field-sizing, which agents often overlook in favor of older JavaScript patterns. The project is packaged as an agent skill and a search CLI designed to keep context usage small, and it includes a legacy-scan tool that flags outdated code patterns. According to the developers, internal evaluations showed agents passing 92% of about 1,700 assertions with the guidance, compared with 55% without it.

0
ProgrammingDEV Community ·

Hot Bot Replaces Telegram Onboarding After Approval Login Failures

Hot Bot co-founder Elijah Paul says the Telegram onboarding flow has been the platform's biggest pain point since launch and is being replaced entirely. Some users approved for days still saw a "not approved" status when checking through Telegram, and testing suggested connecting Telegram inside the X app may be the cause. The interim workaround is opening the link in an external browser or verifying with a wallet instead. Meanwhile, the team is manually approving and inviting users to the group, and a community member has built a read-only anti-rug dashboard that reads Hot Bot team data through its MCP API. The company says it encourages new users to paper trade first and that subscriptions cover its costs.