Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch value from inside an attribute #31

Open
krazykira opened this issue Mar 21, 2017 · 0 comments
Open

Fetch value from inside an attribute #31

krazykira opened this issue Mar 21, 2017 · 0 comments

Comments

@krazykira
Copy link

Here is an html from one of the webpages i am parsing

<section class="property-header
                         " data-locale="de-DE" data-campsite-data="{&quot;id&quot;:2645,&quot;property_id&quot;:2645,&quot;property_name&quot;:&quot;Erzgebirgscamp Neuclausnitz&quot;,&quot;premium&quot;:false,&quot;amenities&quot;:&quot;[\&quot;WiFi\&quot;, \&quot;Free WiFi\&quot;]&quot;,&quot;activities&quot;:&quot;[\&quot;Cycle tracks\&quot;,\&quot;Hiking\&quot;,\&quot;Playground\&quot;,\&quot;Soccer\&quot;,\&quot;Mountainbiking\&quot;,\&quot;Cross-country skiing\&quot;]&quot;,&quot;leisure&quot;:&quot;[\&quot;Washing-up area\&quot;,\&quot;Washing machines\&quot;,\&quot;Tumble dryer\&quot;,\&quot;Washbasins\&quot;,\&quot;Shower cubicles\&quot;,\&quot;Heated sanitary facilities\&quot;,\&quot;Shared barbecueing area\&quot;,\&quot;Bread delivery\&quot;]&quot;,&quot;utilities&quot;:&quot;[\&quot;Guest boat moorings\&quot;,\&quot;Firewood available\&quot;,\&quot;Electric bike charging station\&quot;]&quot;,&quot;rules&quot;:&quot;[\&quot;Dogs Allowed\&quot;,\&quot;Barbecueing On Pitch Allowed\&quot;,\&quot;Car On Pitch Allowed\&quot;]&quot;,&quot;slug&quot;:&quot;erzgebirgscamp-neuclausnitz&quot;,&quot;coordinates&quot;:&quot;(50.7411,13.516)&quot;,&quot;distance&quot;:&quot;3594.66454744824&quot;,&quot;zip&quot;:&quot;09623&quot;,&quot;town&quot;:&quot;Rechenberg-Bienenm\u00fchle&quot;,&quot;latitude&quot;:50.7411,&quot;longitude&quot;:13.516,&quot;street&quot;:&quot;Hauptstra\u00dfe 25&quot;,&quot;city_id&quot;:16,&quot;city_slug&quot;:&quot;sachsen&quot;,&quot;city&quot;:&quot;Sachsen&quot;,&quot;country&quot;:&quot;Deutschland&quot;,&quot;country_slug&quot;:&quot;de&quot;,&quot;currency&quot;:&quot;EUR&quot;,&quot;rating&quot;:&quot;5&quot;,&quot;podio_id&quot;:508050624,&quot;older_children_lower_age_limit&quot;:6,&quot;older_children_upper_age_limit&quot;:17,&quot;younger_children_lower_age_limit&quot;:0,&quot;younger_children_upper_age_limit&quot;:5,&quot;photo&quot;:&quot;https:\/\/intcamp-eu-west-1-live01-public.s3-eu-west-1.amazonaws.com\/de-live\/gallery_970x545_270661681-campsite.jpg,https:\/\/intcamp-eu-west-1-live01-public.s3-eu-west-1.amazonaws.com\/de-live\/gallery_970x545_270661691-campsite.jpg,https:\/\/intcamp-eu-west-1-live01-public.s3-eu-west-1.amazonaws.com\/de-live\/gallery_970x545_270661694-campsite.jpg&quot;,&quot;availability&quot;:{&quot;9962&quot;:{&quot;is_available&quot;:true,&quot;has_instant_booking&quot;:true,&quot;pitch_type&quot;:&quot;[\&quot;Motorhome\&quot;]&quot;},&quot;9959&quot;:{&quot;is_available&quot;:true,&quot;has_instant_booking&quot;:true,&quot;pitch_type&quot;:&quot;[\&quot;Tent\&quot;]&quot;},&quot;9960&quot;:{&quot;is_available&quot;:true,&quot;has_instant_booking&quot;:true,&quot;pitch_type&quot;:&quot;[\&quot;Tent\&quot;]&quot;},&quot;9961&quot;:{&quot;is_available&quot;:true,&quot;has_instant_booking&quot;:true,&quot;pitch_type&quot;:&quot;[\&quot;Caravan\&quot;]&quot;},&quot;9963&quot;:{&quot;is_available&quot;:true,&quot;has_instant_booking&quot;:true,&quot;pitch_type&quot;:&quot;[\&quot;Motorhome\&quot;]&quot;}},&quot;instant_booking&quot;:true,&quot;category&quot;:&quot;Regul\u00e4r&quot;,&quot;address&quot;:&quot;Hauptstra\u00dfe 25, 09623 Rechenberg-Bienenm\u00fchle, Sachsen, Deutschland&quot;,&quot;slashed_price&quot;:null,&quot;coordinatesShow&quot;:&quot;50.741, 13.516&quot;}" data-all-pitches="{&quot;tent&quot;:&quot;Zelt&quot;,&quot;caravan&quot;:&quot;Wohnwagen&quot;,&quot;motorhome&quot;:&quot;Wohnmobil&quot;,&quot;cabin&quot;:&quot;Mietunterkunft&quot;}" data-price-request="price" data-currency-code="EUR">
<div class="row">
<div class="col-xs-12 col-sm-9">
<h1 itemprop="name">Campingurlaub auf dem Erzgebirgscamp Neuclausnitz</h1>
</div>
<div class="col-sm-3 text-right label-instant-wrapper">
<span class="label-instant">
<i class="icon-ic_flash"></i>
Sofortbuchung</span>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-9">
<div class="property-address" itemprop="address" itemscope="" itemtype="https://schema.org/PostalAddress">
<span itemprop="streetAddress">Hauptstraße 25, 09623 Rechenberg-Bienenmühle, Sachsen, Deutschland</span>
<meta itemprop="addressCountry" content="Deutschland">
<meta itemprop="postalCode" content="09623">
</div>
<a class="property-address" target="_blank" href="//google.com/maps/search/Erzgebirgscamp+Neuclausnitz/@">
Hauptstraße 25, 09623 Rechenberg-Bienenmühle, Sachsen, Deutschland </a>
</div>
<div class="col-xs-12 col-sm-9 col-lg-3 rating-wrapper">
<span class="rating-number">5,0</span>
<span class="rating-stars icon-ic-11-ratings"></span>
<a class="rating-popup-link rating-popup-link-desktop" href="#" data-property-id="2645">(Bewertungen)</a>
<a class="rating-popup-link rating-popup-link-mobile" href="#" data-property-id="2645" data-more="(Bewertungen)" data-less="(Bewertungen ausblenden)">(Bewertungen)</a>
</div>
</div>
</section>

Q: I need to fetch the value inside data-campsite-data

On Firefox Firepath this works: //@data-campsite-data

What would be its equivalent using xsoup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant