I'm trying to scrape the following content attributes from this site using a googlesheet. Unfortunately every variation i can think of seems to fail
<span itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue" content="3.5"></span>
<span itemprop="ratingCount" content="12"></span>
<span itemprop="reviewCount" content="12"></span>
</span>
I'm looking to extract the values 3.5, 12 & 12 using
=importxml(A2,//*[#id='topOnProduct']/div[2]/span/span[1])
=importxml(A2,//*[#id='topOnProduct']/div[2]/span/span[1]#content)
=importxml(A2,"//span[#itemprop='ratingValue']/#content")
and about 50 other variations on the respective attributes - i'm also having no joy using kiimono. Can anyone advise me where i'm going wrong/show me how to achieve this
Related
using of multiple localBusiness in one page - schema. is it correct?
Here is my code.
<div itemscope itemtype="http://schema.org/LocalBusiness">
<span itemprop="description"> A superb collection of fine gifts and clothing
to accent your stay in Mexico Beach.</span>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">3102 Highway 98</span>
<span itemprop="addressLocality">Mexico Beach</span>,
<span itemprop="addressRegion">FL</span>
</div>
Phone: <span itemprop="telephone">850-648-4200</span>
</div>
<div itemscope itemtype="http://schema.org/LocalBusiness">
<h1><span itemprop="name">Beachwalk Beachwear & Giftware</span></h1>
</div>
Please guide me if I am doing it wrong.
Yes you can use multiple localBusiness in one page just make sure there are no error in the markup, see the http://schema.org/LocalBusiness and test you code in google Structured Data Testing Tool
for example in you code there are 2 error and one warning in the first localBusiness there is no image and no name and those are required
and The priceRange field is recommended.
in the second localBusiness there are 1 error and 3 warning.
like i said text your code and then put it in your web site.
if the google Structured Data Testing Tool say that everything is okey then there is no problem
I have searched stackoverflow and the web and I can't find an direct answer to this question.
On my website I have added the schema information for the price of an item (see below)
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
Adults and over 10 years old Presale– <span itemprop="price" content="10.00">
<span itemprop="priceCurrency" content="USD">
<span itemprop="availability">
<span itemprop="availabilityStarts" content="2017-01-01T00:00">
<span itemprop="availabilityEnds" content="2017-03-17T23:00">
<span itemprop="inventoryLevel" content="10000">
<span itemprop="url" content="http://www.website.com">
$10</span></span></span></span></span></span></span>
</span>
So as you can see, I have a TON of <span > code. I want to try and reduce this.
I have tested the validation of this snippet via W3C and it validated just fine.
What I am curious about is A) is there a better way, and B) can I just reduce to 1 <span> and include all of that in one so it would look like this:
<span itemprop="priceCurrency" content="USD">
<span itemprop="availability" itemprop="availabilityStarts" content="2017-01-01T00:00" itemprop="availabilityEnds" content="2017-03-17T23:00" itemprop="inventoryLevel" content="10000" itemprop="url" content="http://www.website.com">
Or am I trying to cram too much in one area?
In principle, what you did is fine. However, you currently list the itemprop and content attributes many times on this single <span> element. This is invalid HTML.
Instead, I recommend using data-* attributes.
<span data-price="10.00"
data-price-currency="USD"
data-availability="true"
data-availability-starts="2017-01-01T00:00"
data-availability-ends="2017-03-17T23:00"
data-inventory-level="10000"
data-url="http://www.example.com"></span>
Further reading: using data attributes.
My site is https://www.liteshop.com.au/content/olight-h15s-wave-rechargeable-led-headlamp
We implemented rich snippets on my site seven weeks ago but still Google does not show on search. Testing tool shows "All good".
Here is the rich snippets markup:
<div prefix="gr: http://purl.org/goodrelations/v1# v: http://rdf.data-vocabulary.org/#" resource="#gr-ProductOrService" typeof="gr:ProductOrService">
<span property="gr:name" content="Olight H15S Wave 250 lumen rechargeable LED headlamp"></span>
<span property="gr:brand" content="Olight"></span>
<span property="gr:image" content="https://www.liteshop.com.au/sites/default/files/olight_h15s_led_headlamp_01.jpg" ></span>
<span property="gr:description" content="98g, 250 lumens: The H15S Wave is a powerful and intelligent head lamp with a rechargeable battery pack and infrared sensor for hands free operation. With 250 lumens of white light, three brightness levels and up to 36 hours of run time, it’s the perfect choice for any challenge you might face in the outdoors. Battery and USB charger included. Can also use 4 X AAA."></span>
<span property="gr:sku" content="Olight H15S"></span>
<span property="gr:url" content="https://www.liteshop.com.au/content/olight-h15s-wave-rechargeable-led-headlamp"></span>
<span property="gr:availability" content="In Stock"></span>
<span property="gr:hasPriceSpecification" typeof="gr:UnitPriceSpecification">
<span property="gr:hasCurrencyValue" content="69.95"></span>
<span property="gr:hasCurrency" content="AUD"></span>
</span>
<span property="v:hasReview" typeof="v:Review-aggregate" >
<span property="v:itemReviewed" content="Olight H15S Wave 250 lumen rechargeable LED headlamp" ></span>
<span property="v:rating" content="5" ></span> <span property="v:votes" content="2" ></span>
</span>
<span property="v:aggregateRating" typeof="v:AggregateRating" >
<span property="v:reviewCount" content="3" ></span>
</span>
</div>
According to http://wiki.goodrelations-vocabulary.org/Quickstart 'xml:lang="en"' is required for name or description property. Is this the problem?
You are using the vocabularies GoodRelations and Data-Vocabulary.org.
According to Google’s technical guidelines for structured data, they support only¹ the vocabulary Schema.org:
Structured data should be expressed using the most specific applicable type and property names defined by schema.org.
¹ Data-Vocabulary.org was used for their Rich Snippets before; I don’t know if they still support it, but it seems that they don’t document it anymore.
#unor is correct and your syntax is correct. If you changed to schema.org, you would encounter another problem. Google will not accept content=" ". The value for content must be in the clear, i.e term">content_value</term".
I'm improving the markup for the Products section of a site of mine by using Microdata. Everything is doing just fine, as the info is being showed in the Google results as expected.
But I think it would be nice to specify a category to a given product. I've searched everywhere and rode every attribute spec found in http://Schema.org/Product but it seems there is nothing there I can use to spec a "Category".
I tried to set itemprop="category" but Google's Rich Snippet Tool gives me this warn: "Page contains property "category" which is not part of the schema.", which is true.
Does anyone knows which property should I use to designate the Category for a Product? Any thoughts on this would be nice.
schema.org/Offer has category property.
A category for the item. Greater signs or slashes can be used to
informally indicate a category hierarchy.
So smth like that will work.
<div itemscope itemtype="http://schema.org/Product">
<span itemprop="name">Kenmore White 17" Microwave</span>
<img src="kenmore-microwave-17in.jpg" alt='Kenmore 17" Microwave' />
<div itemprop="aggregateRating"
itemscope itemtype="http://schema.org/AggregateRating">
Rated <span itemprop="ratingValue">3.5</span>/5
based on <span itemprop="reviewCount">11</span> customer reviews
</div>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<span itemprop="price">$55.00</span>
<link itemprop="availability" href="http://schema.org/InStock" />In stock
<span itemprop="category">LargeCategory > SmallCategory</span>
</div>
</div>
OR
Another option is to use data-vocabulary.org which has category property in its Product class. OK for Google, NOT OK for other Search Engines though. But for Google it will work. Smth like that:
<div itemscope itemtype="http://data-vocabulary.org/Product">
<span itemprop="brand">ACME</span> <span itemprop="name">Executive
Anvil</span>
<img itemprop="image" src="anvil_executive.jpg" />
<span itemprop="description">Sleeker than ACME's Classic Anvil, the
Executive Anvil is perfect for the business traveler
looking for something to drop from a height.
</span>
Category: <span itemprop="category" content="Hardware > Tools > Anvils">Anvils</span>
Product #: <span itemprop="identifier" content="mpn:925872">
925872</span>
<span itemprop="review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">
<span itemprop="rating">4.4</span> stars, based on <span itemprop="count">89
</span> reviews
</span>
<span itemprop="offerDetails" itemscope itemtype="http://data-vocabulary.org/Offer">
Regular price: $179.99
<meta itemprop="currency" content="USD" />
$<span itemprop="price">119.99</span>
(Sale ends <time itemprop="priceValidUntil" datetime="2020-11-05">
5 November!</time>)
Available from: <span itemprop="seller">Executive Objects</span>
Condition: <span itemprop="condition" content="used">Previously owned,
in excellent condition</span>
<span itemprop="availability" content="in_stock">In stock! Order now!</span>
</span>
</div>
You can find out more about this vocabulary here.
I don't get it
On http://schema.org/Product there is category mentioned ( under brand ), still in https://developers.google.com/structured-data/testing-tool/ it apears as an error.
Have they added this attribute recently?
I am looking to include rich snippets into a site I'm building to reflect a musician's upcoming tour schedule. I have done some searching on various musicians and have found a few which seem to follow a similar format. I have uploaded two screen shots below to show as an example of what I mean exactly.
Example 1:
Example 2:
What is puzzling me is the fact that when I enter these sites into Google's Rich Snippet Test Tool, no data shows up. Furthermore, when I check the source for one of the tour pages, there are no rich snippets incorporated into the code. How are these sites managing to get their tour dates listed in this format?
You are correct, these band pages are not implementing rich snippets of any form. What Google is actually doing is showing information pulled from other sites about that band. This information comes from the sites listed on the "More Info" line. These 3rd party sites are the ones implementing rich snippets into their pages.
I don't have enough rep to comment on Oded's "answer" to this question, but he is completely wrong. Microformats are an accepted form of rich snippet markup, just like microdata and RDFa. I would recommend going with Schema.org microdata on your site, though, since Google is presenting it as the future of rich snippet markup
As Johnathon mentioned, the future really belongs to microdata format, because it's the part of the new HTML5. I highly recommend to use this format.
I believe that this is the even rich snippet, which have you showed in your post. You can implement your event rich snippet like this:
<div itemscope itemtype="http://data-vocabulary.org/Event">
<a href="http://www.example.com/events/spinaltap" itemprop="url" >
<span itemprop="summary">Spinal Tap</span>
</a>
<img itemprop="photo" src="spinal_tap.jpg" />
<span itemprop="description">After their highly-publicized search for a new drummer,
Spinal Tap kicks off their latest comeback tour with a San
Francisco show.</span>
When:
<time itemprop="startDate" datetime="2015-10-15T19:00-08:00">Oct 15, 7:00PM</time>—
<time itemprop="endDate" datetime="2015-10-15T19:00-08:00">Oct 15, 9:00PM</time>
Where:
<span itemprop="location" itemscope itemtype="http://data-vocabulary.org/Organization">
<span itemprop="name">Warfield Theatre</span>
<span itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
<span itemprop="street-address">982 Market St</span>,
<span itemprop="locality">San Francisco</span>,
<span itemprop="region">CA</span>
</span>
<span itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">
<meta itemprop="latitude" content="37.774929" />
<meta itemprop="longitude" content="-122.419416" />
</span>
</span>
Category: <span itemprop="eventType">Concert</span>
<span itemprop="ticketAggregate" itemscope itemtype="http://data-vocabulary.org/Offer-aggregate">
Tickets from $<span itemprop="lowPrice">10.00</span>-$<span itemprop="highPrice">11.00</span>
<span itemprop="currency" content="USD" />
<span itemprop="offerCount">2,000</span> tickets available
<a href="http://www.example.com/events/spinaltap/alltickets" itemprop="offerurl">
http://google.com/ticket</span>See all available tickets</a>
</span>
<span itemprop="tickets" itemscope itemtype="http://data-vocabulary.org/Offer">
Presale tickets
<span itemprop="price">$10</span><span itemprop="currency" content="USD" />
till <time itemprop="priceValidUntil" datetime="2015-11-10">10 November 2015</time>
(<span itemprop="quantity">1000</span> available)
</span>
<span itemprop="tickets" itemscope itemtype="http://data-vocabulary.org/Offer">
Full-price tickets
<span itemprop="price">$11</span><span itemprop="currency" content="USD" />
</span>
</div>
If you still having problems, then take a look at this Google article http://support.google.com/webmasters/bin/answer.py?hl=en&answer=164506&topic=1088474&ctx=topic.
To know more about rich snippets, what are they, what are they useful for and what type of rich snippets exist, check my article at http://blog.victorlava.com/what-is-a-rich-snippet-everything/.
I also agree that Google not only fetches and displays rich snippet data from the owner website or the querying website, but it also uses third party data to pull the result into the rich snippet friendly search result links.
Recently, Google has been pushing a lot of data using its Knowledge Graph and updated search algorithms. However it depends on many factors to see your site's data into Google search result using the rich snippet format. Factors like your site's authority, popularity, content trustworthy generally play vital role and that's what happening with the above example case.
Thanks