Create Xpath Manually - xpath

I want to create xpath which must contain word "Asia"
//div[#id='destination-loadLevel0']/div/ul/li/div/div/span
*for Asia
//div[#id='destination-loadLevel0']/div/ul/li[2]/div/div/span
*for Europe
//div[#id='destination-loadLevel0']/div/ul/li[3]/div/div/span
*for USA
//<div class="col-md-3 level-column column-viewport" id="destination-loadLevel0">
<div class="row">
<ul>
<li class="col-md-3 col-hotspot unselectable-text" data-parent-group-id="" data-groupid="2244604" data-name="Asia;|03|00|00|">
<div class="tile-container">
<div class="image-label" data-toggle="tooltip" data-container="body" data-placement="top" title="" data-original-title="Asia">
<span class="title ellipsis">Asia</span>
<span class="icon icon-angle-right"></span>
</div>

//*[contains(text(),'Asia')] | //#*[contains(.,'Asia')]/parent::*
returns all elements whose text contains 'Asia' or whose attribute values contains 'Asia'
Output :
<li class="col-md-3 col-hotspot unselectable-text" data-parent-group-id="" data-groupid="2244604" data-name="Asia;|03|00|00|" />
<div class="image-label" data-toggle="tooltip" data-container="body" data-placement="top" title="" data-original-title="Asia" />
<span class="title ellipsis">Asia</span>

Related

How to extend views with shared Layout in Laravel?

I have a collection of views that i want them to share a specific layout.
I created the layout master.blade.php ,in a folder i named it layouts.
From the docs , i found that i need to add the tag #extends and section('content') in my view so it fits under the layout :
#extends('layouts.master')
#section('content')
<div style="background-color:white;width:963px;height:100%">
<div style="padding-top:100px;padding-bottom:200px">
<h2 style="color:sandybrown; text-align:center"><b style="padding-right:40px">Contactez nous</b></h2>
<br />
<hr width="50%" color="gris" />
<div class="row">
<div class="col-md-6" style="padding:5%">
<form method="post" asp-controller="Home" asp-action="RegisterContact" style="padding-left:20px">
<label><span style="color:blue">Nom et prenom</span></label>
<br />
<input size=" 40" style="border-color:darkorange" asp-for="Name"/>
<br />
<label><span style="color:blue">E-mail</span></label>
<br />
<input size=" 40" asp-for="Email" style="border-color:darkorange" />
<br />
<label><span style="color:blue">Message</span></label>
<br />
<textarea rows="10" cols="40" style="border-color:darkorange" asp-for="Message"></textarea>
<br />
<button style="background-color:blue;"><span style="color:white">ENVOYER</span></button>
....
#endsection
but when i click in the link in the view's link in the navbar , this is what i get ?:
so is there a missing part in the logic ?
Update:
the view and the layout are both under the same folder :
C:\xampp\htdocs\laravel\resources\views\layouts
the view's name wasn't ending with .blade.php , but doing so now i get an exception :
InvalidArgumentException in FileViewFinder.php line 137: View [layouts.WhoWeAre] not found.
this is the body code of the layout :
</div>
<nav class="navbar navbar-expand-md bg-light navbar-light">
<div class="navbar-collapse collapse w-50">
<ul class="navbar-nav ml-auto">
<li class="nav-item navbar1 ">
<a class="nav-link" href="{{action('HomeController#WhoWeAre')}}"><span style="text-decoration: underline;"><B>Acceuil</B></span></a>
</li>
<li class="nav-item navbar1">
<a class="nav-link" ><span style="text-decoration: underline;"><B>Qui somme nous</B></span></a>
</li>
<li class="nav-item navbar1">
<a class="nav-link"><span style="text-decoration: underline;"><B>Specialités</B></span></a>
</li>
</ul>
</div>
<div>
<img src="images/decoupage/nawrass-logo.png " class="rounded-circle bg-light">
</div>
<div class="navbar-collapse collapse w-50 ">
<ul class="navbar-nav mr-auto">
<li class="nav-item navbar2">
<a class="nav-link" >
<span style="text-decoration: underline;"><B>Contactez-nous</B></span>
</a>
</li>
<li class="nav-item navbar2">
<img src="images/decoupage/location.png" style="padding-top: 7px">
<span style="padding-top: 15px">Djerba Houmet Souk</span>
</li>
<li class="nav-item navbar2">
<div class="row">
<div class="col-md-3" style="padding-top: 7px">
<img src="images/decoupage/phone.png">
</div>
<div class="col-md-8" style="font-size: 16px;">
<span>75 620 660 </span>
<br>
<span>98 816 962</span>
</div>
</div>
</li>
<li class="nav-item navbar2">
<img src="images/decoupage/fb.png" style="padding-top: 7px">
</li>
</ul>
</div>
</nav>
<div class="container " style="min-height:100%; padding-left:120px;flex:1;display:flex;flex-direction:column;">
<div style="flex:1;display:flex;flex-direction:column;">
#yield('content')
</div>
</div>
<div id="footer">
<div class="jumbotron " style="margin-top:0 ; background-color:blue">
<div class="container ">
<div class="row">
<div class="col-md-6">
<div class="card mb-3 " style="background-color: blue">
<div class="row no-gutters">
<div class="col-md-3 ">
<img src="images/decoupage/logo-white.png" class="card-img" alt="my card image">
</div>
<div class="col-md-9 ">
<div class="card-body ">
<p class=" card-text text-white " style="font-size: 14.45px">
Bienvenu a centre de formation ennawres: formation en coiffure hommes et dames Langues {francais, anglais...} ,photographie..et plusieurs d'autres..
</p>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-2"></div>
<div class="col-md-4 ">
<br/>
<img src="images/decoupage/phone.png">
<span class="text-white">
75620660-98815952
</span>
<br>
<br>
<img src="images/decoupage/location.png">
<span class="text-white">
Houmet Souk Djerba,1Km Ajim
</span>
</div>
</div>
<div class="row">
<div class="col-md-6 offset-md-4 text-white">
PROPULSE PAR MOSAIQUE WEB COPYRIGHT 2019
</div>
</div>
</div>
</div>
</div>
For information the click in the navbar "Qui sommes nous" link trigger this controller method:
public function WhoWeAre()
{
return view('layouts/WhoWeAre');
}
and this is routes.php :
Route::get('/', function () {
return view('welcome');
});
Route::get('/whoweare', 'HomeController#WhoWeAre');

How to get href value in using HtmlAgilityPack?

How do I retrieve the values of HREF Tag using HTML AgilityPack?
<div class="row">
<div class="col-sm-24 businessCapsule--ctas">
<a href="http://www.xyz.coo.in" data-tracking="FLE:WL:CLOSED" class="businessCapsule--ctaItem" target="_blank" rel="nofollow noopener">
<div class="icon icon-Business-website" title="Website"></div> Website</a>
<div class="businessCapsule--telephone">
<div class="business--telephone business--telephone-noMarginRight">
<span class="icon icon-phone business--telephoneIcon"></span>
<div class="business--telephoneContent">
<span class="business--telephonePrefix">Tel</span>
<span class="business--telephoneNumber" itemprop="telephone">154 75 695 451 </span>
Try with a.Attributes.First().Value;
Where "a" is the HtmlNode that you want

image and data is not showing adjacent in bootstrap3

I am trying to image and its relevant data in bootstrap. For that I am writing code like below
<div class="col-xs-12 col-sm-3 col-sm-push-9">
<p style="padding:20px;"></p>
<h3 align=center>Our Lipsmacking Culinary Creations</h3>
</div>
<div class="col-xs-12 col-sm-9 col-sm-pull-3">
<div class="media">
<div class="media-left media-middle">
<a href="#">
<img class="media-object img-thumbnail" src="img/uthappizza.png" alt="Uthappiza">
</a>
<div class="media-body">
<h2 class="media-heading">Uthappizza</h2>
<p>A unique combination of Indian Uthappam (pancake) and
Italian pizza, topped with Cerignola olives, ripe vine
cherry tomatoes, Vidalia onion, Guntur chillies and
Buffalo Paneer.</p>
<p><a class="btn btn-primary btn-xs" href="#">More »</a></p>
</div>
</div>
</div>
</div>
I am getting output like this:
enter image description here
I want it to be side by side I don't know where I am going wrong.
Add pull-left to your image as a class. Bootply.

Why does image has that padding?

I'm trying out to squeeze the columns into two while the page is xs size. I did the necessary logic, and also tried to implement the same with an using img. However while using an image, I'm unable to force the image to take the full size of the block. I've tried all necessary css editing and stuff, maybe I'm missing something please help.
Take help of the jsfiddle link to understand it better. I've included the css in fiddle file
Js Link!
<html>
<style>
</style>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid ">
<div class="navbar-header ">
<button type="button" class="navbar-toggle pull-left " data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<form class="navbar-form pull-left my-searchmain" role="search">
<div class="input-group ">
<input type="text" class="form-control " placeholder="Search">
<div class="input-group-btn">
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
</div>
</div>
</form>
</div>
<div class="collapse navbar-collapse " id="myNavbar">
<ul class="nav navbar-nav navbar-right col-lg-12 col-md-12 col-sm-12">
<li class="active col-lg-1 col-xs-6 col-md-1 col-sm-1"><img id="imgnew" src="http://www.affordable-templates123.com/wp-content/uploads/2015/05/fancy-label-templates-nh8tgtgq.jpg" ></li>
<li class="dropdown col-lg-1 col-xs-6 col-md-1 col-sm-1">
<a class="dropdown-toggle " data-toggle="dropdown" href="#">Page 2 </a>
<ul class="dropdown-menu">
<li>Page 1-1</li>
<li>Page 1-2</li>
<li>Page 1-3</li>
</ul>
</li>
<li class=" col-lg-1 col-xs-6 col-md-1 col-sm-1">Page 3</li>
<li class=" col-lg-1 col-xs-6 col-md-1 col-sm-1">Page 4</li>
<li class=" col-lg-1 col-xs-6 col-md-1 col-sm-1">Page 5</li>
<li class=" col-lg-1 col-xs-6 col-md-1 col-sm-1">Page 6</li>
<li class=" col-lg-1 col-xs-6 col-md-1 col-sm-1">Page 7</li>
<li class=" col-lg-1 col-xs-6 col-md-1 col-sm-1">Page 8</li>
<li class="col-xs-push-1">
<form class="navbar-form my-search " role="search">
<div class="input-group ">
<input type="text" class="form-control " placeholder="Search">
<div class="input-group-btn">
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
</div>
</div>
</form>
</li>
</ul>
</div>
</div>
</nav>
</body>
</html>
Afsan Abdulali Gujarati, I think for what I understand here, you want the xs view menu text to all stay on the right in one vertical line.
To stop the text wrapping around below the image. The image being responsive is full width of the col-xs-6. But it looks like you are trying or meaning to have the image the same height of the text links on the right.
Hopefully the way it lines up now is ok.
Have a look at this Fiddle.
All I did here was to add padding-bottom:200px; to the litht holds the image.
See if this does what you want.
.keepclear{
padding-bottom:200px;
}
Added
To remove any padding around a image in a navbar add this to your custom css to override Bootstrap css classes.
.navbar-nav > li > a {
padding-top: 0;
padding-bottom: 0;
padding-left:0;
padding-right:0;
}

xpath specific selection with condition

this might be simple, but I would like to select everything within <div class="rc-box-citations-body"> under the condition that it must belong to <div class="definitionBox" id="meaning-1-1">, thereby uniquely identifying it. How can I do that with xpath? Thanks.
<div class="definitionIndent">
<div class="definitionNumber">1.a</div>
<div class="definitionIndent">
<div class="definitionBox" id="meaning-1-1">
<span class="textmedium">
<span class="stampNoBorder">text</span>
<span class="definition">text</span>
</span>
</div>
<div class="definitionBox">
<div class="rc-box-citations">
<div class="rc-box-citations-top">
<span class="rc-citations-north-west"> </span>
<span class="rc-citations-north-east"> </span>
</div>
<div class="rc-box-citations-body"><span class="citat">text</span> <a class="sourcepop" href="javascript:void(0);"><span class="source">text</span><span class="popup">text</span></a></div>
<div class="rc-box-citations-bot">
<span class="rc-citations-south-west"> </span>
<span class="rc-citations-south-east"> </span>
</div>
</div>
</div>
</div>
</div>
If I modify your xml slightly, and take under the condition that it must belong to to mean that is a descendant of.... then this xpath works
//div[#class='definitionBox'][#id='meaning-1-2']//div[#class='rc-box-citations-body']
The XML is
<?xml version="1.0" encoding="utf-16"?>
<div class="definitionIndent">
<div class="definitionNumber">1.a</div>
<div class="definitionIndent">
<div class="definitionBox" id="meaning-1-1">
<span class="textmedium">
<span class="stampNoBorder">text</span>
<span class="definition">text</span>
</span>
</div>
<div class="definitionBox" id="meaning-1-2">
<div class="rc-box-citations">
<div class="rc-box-citations-top">
<span class="rc-citations-north-west"></span>
<span class="rc-citations-north-east"></span>
</div>
<div class="rc-box-citations-body">
<span class="citation">text</span>
<a class="sourcepop" href="javascript:void(0);">
<span class="source">text</span>
<span class="popup">text</span>
</a>
</div>
<div class="rc-box-citations-bot">
<span class="rc-citations-south-west"></span>
<span class="rc-citations-south-east"></span>
</div>
</div>
</div>
</div>
</div>
The tool I used is XPathVisualizer:

Resources