Can't Seem to Get CSS Selector to Work

WP Intense Q & ACategory: Price Comparison ProCan't Seem to Get CSS Selector to Work
Kameron Scott asked 2 years ago

Hi, I’m trying to get the scraper to work for the Price Comparison Pro plugin but can’t seem to figure it out.

Here’s the page I’ve added it to: http://staging.caraudionow.com/best-car-stereos/ (it’s on the first product)

The price scraper is currently pulling from:

  1. https://www.amazon.com/Pioneer-DEH-X8800BHS-Receiver-Bluetooth-SiriusXM/dp/B01GK59KAE/. The ID it’s looking for on this page is: #priceblock_ourprice. Yet it shows up Blank every time. I’ve tried other URLs. Do you know what the problem is with this one?
  2. For the second one (Crutchfield), the url is https://www.crutchfield.com/S-MNM7AH8srq7/p_130X8800BS/Pioneer-DEH-X8800BHS.html and it’s looking for the class .priceNow. But it’s showing the price, and other text. I can’t seem to find a way to just pull the price. Can you help with finding the correct css selector for this one as well?

Thanks in advance.

John M. replied 2 years ago

Hi Kameron

I hope you had a nice weekend.

One of the dev team will be in contact soon to help you with this.

Kind regards

John

Kameron S. replied 2 years ago

Thanks John, how will they be in contact? I have yet to hear something. Thanks

Kameron S. replied 2 years ago

Hey John, just following up. Still haven’t heard anything.

1 Answers
Dave Hilditch Staff answered 2 years ago

For the crutchfield one, you were close but yes – the CSS selector chrome shows will include the text.

You should be able to extend it to this to grab just the price:

.buyBoxContainer .prodBuyBox .priceInfo .priceNow span[itemprop=price]

For the Amazon one, it’s definitely not a CSS selector issue – that CSS selector you’re using is correct.

Some possibilities:

  1. The location of your server may be affecting the page returned – maybe Amazon is redirecting your scraper to a completely different page?
  2. Amazon may have blocked your server

We have a free trial of our scraper service you can use which will solve this.

Kameron S. replied 2 years ago

@dave the Crutchfield selector works! Thanks. I double checked the URL and there weren’t any redirects that I noticed. I’ll try to use the scraper service but FYI your checkout is broken. I can’t subscribe to the service it just says “Sorry, no products matched your selection. Please choose a different combination.” I’ve tried in multiple browsers while logged in and out. Let me know when this is fixed and I’ll give it a try.

Kameron S. replied 2 years ago

@dave, was finally able to checkout and purchase the scraper. I entered in the API key, tested. No luck. Please help. We’ve been going back and forth on a number of bugs on this plugin for the past two months and I still can’t get this thing to work right!

. replied 2 years ago

Hi – send me login details to support@wpintense.com and I’ll log in and take a look and fix

Kameron S. replied 2 years ago

Sent! Thanks