I want to get Twitter follower numbers on a google spreadsheet.
I used below line code and the result was N/A
=importXML("https://twitter.com/elonmusk","//a[#href='/elonmusk/followers']/span[#class='css-901oao css-16my406 r-poiln3 r-bcqeeo r-qvutc0'")
The HTML code is
<a href="/elonmusk/followers" dir="auto" role="link" class="css-4rbku5 css-18t94o4 css-901oao r-18jsvk2 r-1loqt21 r-1qd0xha r-a023e6 r-16dba41 r-rjixqe r-bcqeeo r-qvutc0">
<span class="css-901oao css-16my406 r-18jsvk2 r-poiln3 r-b88u0q r-bcqeeo r-qvutc0">
<span class="css-901oao css-16my406 r-poiln3 r-bcqeeo r-qvutc0">54.8M</span></span>
<span class="css-901oao css-16my406 r-m0bqgq r-poiln3 r-bcqeeo r-qvutc0">
<span class="css-901oao css-16my406 r-poiln3 r-bcqeeo r-qvutc0">Followers</span></span></a>
Please take a closer look at the span nodes. The span you are trying to target is actually nested within the prior span, it is not a sibling. Try changing this:
//a[#href='/elonmusk/followers']/span[#class='css-901oao css-16my406 r-poiln3 r-bcqeeo r-qvutc0']
to something like the following (note /span/span instead of /span to reflect the actual hierarchy (a/span/span):
//a[#href='/elonmusk/followers']/span/span[#class='css-901oao css-16my406 r-poiln3 r-bcqeeo r-qvutc0']
or the following (note //span instead of /span) if you don't care about the hierarchy between the a and target span nodes:
//a[#href='/elonmusk/followers']//span[#class='css-901oao css-16my406 r-poiln3 r-bcqeeo r-qvutc0']
Related
I have a navbar element. It has a navbar-dropdown element. I want to add a navbar-item with a sentence to it, but word transposition in navbar-item doesn't work.
How can I turn it back on? Here's the code for the navbar-dropdown element.
<div class="is-primary navbar-dropdown is-size-4 dropdown-width">
<div class="navbar-item">
Чтобы воспользоваться функционалом системы, пожалуйста, авторизируйтесь.
</div>
<div class="navbar-item">
<a
class="button is-light"
:class="{ 'is-hidden':$store.state.isAuth }"
#click="openModal"
>
Войти
</a>
</div>
</div>
The "dropdown-width" class sets a fixed width for the element.
There are two each loops , the outer loop 'fields' 'name' value is referenced by the inner loop using {{lookup this ../name}} and is rendering correctly.Each {{../message}} can contain an element {{name}}. I wish with the '{{lookup this ../name}}' being null or undefined that renders nothing rather that a blank space. I was hoping there was an easy way to us if to resolve this.I tried to use an {{#if this ../name}} {{/if} around the area but an error generated e.g.
{{#each ../message}}
{{#if this ../name}}
<a href = "https://issues.jboss.org/browse/{{key}}">
<button class="mini ui blue button"><i class="key icon"></i> {{key}}</button></a>
<button class="mini ui blue basic button">{{lookup this ../name}}</button><br>
{{/if}}
{{/each}}
TypeError: Cannot read property 'includeZero' of undefined
Here is the code as it stands.
<div class="ui raised segment">
<div class="ui styled accordion">
<div class="title">
<i class="dropdown icon"></i>
Results
</div>
<div class="content">
<p class="transition hidden">
<div class="ui styled accordion">
{{#each fields}}
<div class="title">
<i class="dropdown icon"></i>
{{name}}
</div>
<div class="content">
<p class="transition hidden">
{{#each ../message}}
<button class="mini ui blue button"><i class="key icon"></i> {{key}} </button>
<button class="mini ui blue basic button">{{lookup this ../name}}</button><br>
{{/each}}
</p>
</div>
{{/each}}
</div>
</p>
</div>
At first, this question shouldn't be that hard, but I don't know how to solve it.
I'm experimenting with Font-Awesome and everything works fine, except that it won't display just one icon.
Inside the Hml-Editor (Atom):
<body>
<div class="list">
<i class="fa fa-fw fa-home"</i><span>test</span>
</div><!--list-->
</body>
Inside the Browser:
<body>
<div class="list">
<i class="fa fa-fw fa-home" <="" i=""><span>test</span></i><i class="fa fa-fw fa-home" <="" i="">
</i></div><!--list--><i class="fa fa-fw fa-home" <="" i="">
</i>
</body>
Why's there more code in the Browser?
the code is saved with the Atom-Editor and this appears also in a freshly opened Chrome-window (same with Firefox)
Is this even a Browser problem?
After all this seems awkward but thanks for your help.
Your HTML is invalid, the opening i element never gets closed.
Try this:
<body>
<div class="list">
<i class="fa fa-fw fa-home"></i><span>test</span>
</div><!--list-->
</body>
Consider installing htmlhint to get notified about invalid HTML.
i am trying to get the value of Total redemption to be on the same line with the word "Total Redemption" like the way Total Accrued Points looks, i am using an image for my currency symbol and the code for this display is
<div class="item item-body " >
<div class="container">
<div class="right">
Total Accrued Points : {{reportData.accruedpoints}}<br/>
<p>Total Redemption:<img src='img/naira.gif' alt="Naira" height='20' width='20' align='bottom'> {{reportData.redeemableamt | currency : ""}}
</p>
</div>
<a <a href="#/app/transactionsBreakDown/{{reportData.submerchantId}}" class="button button-full button-assertive ink" >View {{reportData.submerchantId}} Details</a>
</div>
</div>
I have an ionic slide box with 4 slides. You can switch between slides by clicking buttons on the bottom of the screen or you can simply scroll with your finger. Class 'active' needs to be added to the button when it's corresponding slide is active.
For example, if the second slide is active I want second button to have class 'active'. When you move to third slide (either by clicking third button or by sliding the screen), class 'active' is removed from second button and added to third button.
Classes now change when you click on a button but not when you scroll between slides. How do I fix this using AngularJS?
Link to Codepen: http://codepen.io/lu-kanemon/pen/doBNGz
Here is my code:
menu.html
<ion-view view-title="Menu">
<ion-content class="padding">
<ion-slide-box show-pager="false" on-slide-changed="slideHasChanged($index)">
<ion-slide>
<h1 class="slide-title"> Matches </h1>
</ion-slide>
<ion-slide>
<h1 class="slide-title"> Fitting jobs </h1>
</ion-slide>
<ion-slide>
<h1 class="slide-title"> Interesting events </h1>
</ion-slide>
<ion-slide>
<h1 class="slide-title"> Group conversations with open positions </h1>
</ion-slide>
</ion-slide-box>
</ion-content>
<div class="contacts-filters felix-filters button-bar">
<a class="button button-stable" ng-class="{active: selected=='m'}" ng-click="slide(0); selected='m'"><i class="fa fa-users"></i></a>
<a class="button button-stable" ng-class="{active: selected=='j'}" ng-click="slide(1); selected='j'"><i class="fa fa-suitcase"></i></a>
<a class="button button-stable" ng-class="{active: selected=='e'}" ng-click="slide(2); selected='e'"><i class="fa fa-map"></i></a>
<a class="button button-stable" ng-class="{active: selected=='c'}" ng-click="slide(3); selected='c'"><i class="fa fa-comments"></i></a>
</div>
</ion-view>
MenuCtrl.js
myApp
.controller('MenuCtrl', function($scope, $stateParams, $ionicSlideBoxDelegate){
//switch slides
$scope.slide = function(to) {
$scope.current = to;
$ionicSlideBoxDelegate.slide(to);
}
});
Just use addClass(className) and removeClass(className) functions
currentElement.removeClass('active');
nextActiveElement.addClass('active');
You can initialize a variable (current) with the first one (if there is at least one), then once the next active element is fired remove the class from current, then set the newest element to current. This repeats over and over!