Urgent.News

What's breaking now, across thousands of outlets.

Tech

I searched Google Hotels for a city that does not exist. It found five hotels.

I typed "hotels in Qwzxvbnmplk" into my Google Hotels scraper to watch it fail. It did not fail. It came back with five hotels near San Antonio, Texas, each with a price, a rating and a map position. This is the story of that answer and the fix. It is also how my fix broke a real capital city, and the small check I now run before I trust any search result. A test that was supposed to fail On 8…

On October 8th, the author was testing inputs that should fail by searching for cities that do not exist. They entered "hotels in Qwzxvbnmplk" into Google Hotels and received five hotel results near San Antonio, Texas, each with prices, ratings, and coordinates. The scraper charged for these priced hotels, even though the search input was nonsensical.

The author discovered that Google always tries to answer a query, even if it cannot find an exact match, by showing hotels nearby. They implemented a fix that resolved the place first, skipped the search if no place was found, and added a field called "resolvedPlace" to identify the understood place. However, this fix broke a real capital city, Prague, as Google sent a page for Prague without its place data.

The author then added a retry mechanism for missing places, but this still led to incorrect results. The author concludes by providing a simple check that can be used to validate the answers from various sources, such as geocoders, search APIs, or entity lookups.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

I searched for Nike and my scraper never found Nike

I asked my Google Ads Transparency scraper for the ads of "nike". It returned ads from two advertisers called Nikena and nikey.

  • Scraper searched for Nike ads but found Nikena and nikey instead
  • Bug in scraper code led to inaccurate advertiser suggestion
  • Fix added match scores and timestamps for ad comparison

What a test HL7 v2 sender has to get right

Sending an HL7 v2 message is easy. Open a TCP socket, wrap the message in MLLP framing, write it, and read whatever comes back.

  • Establish TCP socket connection and wrap message in MLLP framing
  • Ensure ACK is valid by matching MSA-2 to MSH-10 code
  • Handle ambiguous responses by closing connection after timeout or mismatch

More from Friday 9 October →