webpeel 0.21.77 โ†’ 0.21.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5114,14 +5114,38 @@ async function carsComExtractor(html, url) {
5114
5114
  const mileage = v.mileage ? `${Number(v.mileage).toLocaleString()} mi` : '';
5115
5115
  const bodyStyle = v.bodyStyle || '';
5116
5116
  const fuelType = v.fuelType || '';
5117
+ const sellerZip = v.seller?.zip || '';
5117
5118
  if (title && title !== 'Used ') {
5118
- listings.push({ title, price, mileage, bodyStyle, fuelType, url: cardLink });
5119
+ listings.push({ title, price, mileage, bodyStyle, fuelType, url: cardLink, sellerZip });
5119
5120
  }
5120
5121
  }
5121
5122
  catch { /* skip malformed */ }
5122
5123
  });
5123
5124
  if (listings.length === 0)
5124
5125
  return null; // Let pipeline handle it
5126
+ // Extract dealer names from page HTML (text_style:"small", font_color:"grey")
5127
+ const dealerPattern = /"text":"([^"]{3,50})","on_click_interactions":\[\],"text_style":"small","font_color":"grey/g;
5128
+ const dealerNames = [];
5129
+ let _dm;
5130
+ while ((_dm = dealerPattern.exec(html)) !== null) {
5131
+ const name = _dm[1];
5132
+ if (!name.match(/^\d|^Used|^New|mi\)|^Review|^\$/))
5133
+ dealerNames.push(name);
5134
+ }
5135
+ // Extract locations: "City, ST (X mi)" (e.g., "Ridgefield, NJ (8 mi)")
5136
+ const locPattern = /([A-Z][a-z]+(?:\s[A-Z][a-z]+)*,\s[A-Z]{2}\s\(\d+\s*mi\))/g;
5137
+ const locationList = [];
5138
+ let _lm;
5139
+ while ((_lm = locPattern.exec(html)) !== null) {
5140
+ locationList.push(_lm[1]);
5141
+ }
5142
+ // Match dealers and locations to listings (they appear in page order)
5143
+ for (let i = 0; i < listings.length; i++) {
5144
+ if (i < dealerNames.length)
5145
+ listings[i].dealer = dealerNames[i];
5146
+ if (i < locationList.length)
5147
+ listings[i].location = locationList[i];
5148
+ }
5125
5149
  const priceRange = [minPrice && `$${minPrice}`, maxPrice && `$${maxPrice}`].filter(Boolean).join(' โ€“ ');
5126
5150
  const header = [
5127
5151
  `# ๐Ÿš— Cars.com โ€” ${keyword || 'Vehicle Search'}`,
@@ -5139,9 +5163,16 @@ async function carsComExtractor(html, url) {
5139
5163
  l.price,
5140
5164
  l.mileage,
5141
5165
  l.bodyStyle,
5142
- l.url && `[โ†’](https://www.cars.com${l.url})`,
5143
5166
  ].filter(Boolean);
5144
- return parts.join(' ยท ');
5167
+ const line = parts.join(' ยท ');
5168
+ const details = [];
5169
+ if (l.location)
5170
+ details.push(`๐Ÿ“ ${l.location}`);
5171
+ if (l.dealer)
5172
+ details.push(`๐Ÿช ${l.dealer}`);
5173
+ if (l.url)
5174
+ details.push(`๐Ÿ”— [View listing](https://www.cars.com${l.url})`);
5175
+ return line + (details.length ? '\n ' + details.join(' ยท ') : '');
5145
5176
  });
5146
5177
  return {
5147
5178
  domain: 'cars.com',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpeel",
3
- "version": "0.21.77",
3
+ "version": "0.21.78",
4
4
  "description": "Fast web fetcher for AI agents - stealth mode, crawl mode, page actions, structured extraction, PDF parsing, smart escalation from simple HTTP to headless browser",
5
5
  "author": "Jake Liu",
6
6
  "license": "AGPL-3.0-only",