Getting "#N/A" for my "=importXML" function - web-scraping

Trying to scrape data from Messari.io. I'm trying to get "num active addresses" into a google sheet. For "num active addresses" to appear, one must click on the right-hand side of the field to make it viewable. Once seen the element is
< div class="rt-td" role="gridcell" style="flex: 80 0 auto; width: 80px;">
so my google sheet code is
=importxml("messari.io", "//div[#class='rt-td'//text()")
but I know I'm not close...can somebody help on the second argument?

bad news, this website can't be scraped anyhow coz it's fully dependant on JavaScript and Google Sheets is not able to work with JS at all:

Related

HTML5 Links on menubar leaves current page

I have a menu bar that links to local webpages that is working fine except that when I click on the link on the menubar it goes to the webpage in question leaving the webpage with the menubar, but I wish to load the page below the menubar so the user can this use the menubar to navigate. Should I be using iframes? sorry haven't used HMTL5 in quite some time any help is much appreciated.
Neil.
<div class="menu">
Home
Index of Services
Schedule
Examples
</div>
<div class="content">
This page is to help you organise
</div>
Yes, you need frames. Or, the most common, to have the same menu code on all htmls, because with frames your url won't change unless you do some tricks.
If you don't want to duplicate code you could use PHP. Then you could create an index.php with the menus and with includes to the page content.
Edit:
You can also do it with some JavaScript but it also has the same problems with the url. The site will also not work if JavaScript is disabled.
Edit2:
The tricks for frames and javascript I said before can be achieved without url rewrites and with plain HTML+CSS+JS is with anchors.
Basically you change your urls to anchors with the page name, and when the page is first loaded you check this hash so the correct frame opens when someone enters your url like http://mypage.com/#examples. You can access and set the hash with window.location.hash.
So your code would look like:
<div class="menu">
Home
Index of Services
Schedule
Examples
</div>
<div class="content">
This page is to help you organise
</div>
For both with or without frames you need a JavaScript event attached to each menu item.
With frames the JS basically changes the frame url when the user clicks on the menu.
Without frames you use xhr to download the html, and then, if you successfully downloaded the html, you delete everything inside div.content and replace with what you downloaded with innerHtml.
For both solutions you need to add a JS that checks the hash when you first load the page to update the displayed page accordingly.
As for PHP or other server-sided "script" any beginners tutorial will explain how to do it.

Email before download WordPress - No download link

I'm trying to add the option to download an e-book from a website using the plugin "E-mail before download". After filling out the form successfully I never get the download link. I do however, see the container in the inspector:
<div id="wpm_download_1" class="download-link" style="display: none;"></div>
Changing "display: none;" to "display: block;" didn't help.
I installed download manager and already had Contact form 7 running. Everything is set up like it should, as far as I know.
Could anyone give me advice as to what might be causing this?
If the div has no other styling nothing will be shown on the screen, unless it has child elements contained within it. You may need to add other styling (e.g. height, width, etc) to show what you are looking for.

Attribute Selector: Can't isolate one element from the other

I am working with the WP Easy Poll plugin for a site where there people will vote for nominees in different categories. When you use this WP Easy Poll Plugin, you click on the Name of the Nominee and bars animate and show you the number of votes or you have an option to show a percentage of the votes counted. This is done through jquery and PHP.
I want people to be able to vote online but I don't want them to see whose winning until the awards are handed out. So I thought an easy fix would be to use an attribute selector to hide the number of votes but when I do that it hides both the name of the nominee and the votes. I can't just select one - can someone help? I tried everything :(
Here is the selector I tried to use to hide the "20%" next to Dikla Carmel:
div[data-myo-perc="yes"]{display:none;}
<div data-myo-poll-id="334" data-myo-clicked="yes" data-myo-option="0" data-myo-perc="yes" class="myo-poll-votes myo-poll-334 myo-poll-bar" id="myo-poll-334-votes-0" style="cursor: default;">Dikla Carmel 20%</div>
This did not work. It would take out both the nominee's name and the "20%". All I want to do is hide the "20%" until the day after the awards show and then the voters can go online and see by how much the winner won. The attribute for the name is id="myo-poll-340-votes-1" so I don't understand why it selects the name and percentage. I've tried everything. . .
div[data-myo-perc*="yes"]{display:none;} ---> No good
div[data-myo-perc^="yes"]{display:none;} ---> No good
div[data-myo-perc~="yes"]{display:none;} ---> No good
div[data-myo-perc$="yes"]{display:none;} ---> No good
I'm trying to do this for a client - but now I am starting to get confused and I have run out of ideas.
Can anyone help? I looked in the js. and css. files and nothing.
You can see the demo of the plugin here --> WP Polling Link Demo
You cannot isolate part of the text if it isn't selected. You need a way to target it.
jsFiddle here
This does what you are trying to achieve. It effectively hides the percentage, yet displays the name.
HTML
<div data-myo-poll-id="334" data-myo-clicked="yes" data-myo-option="0" data-myo-perc="yes" class="myo-poll-votes myo-poll-334 myo-poll-bar" id="myo-poll-334-votes-0" style="cursor: default;">Dikla Carmel<span>20%</span></div>
CSS
div[data-myo-perc="yes"] span {
display: none;
}

Embedded Facebook Like-Box won't let me style it. Why?

I am trying put place a Facebook Like-Box on a page on my site, and then style it via my own CSS (chiefly to increase the height awarded to div#stream_content. (The idea is to have the FB feed act as a news feed, but I don't want the user to have to scroll to see more the top two items or so as it does by default).
I have read and experimented with suggestions from these articles and more:
http://stackoverflow.com/questions/4064038/customizing-facebook-like-box,
http://www.daddydesign.com/wordpress/how-to-customize-your-facebook-fan-box/,
http://hitech-tips.blogspot.com/2010/05/facebook-like-button-xfbml-tutorial.html
I am going the FBML route (rather than using an iframe) as I gather is required for applying a cross-domain stylesheet. I gather also that I need this doctype declaration for my webpage:
<!doctype html lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en">
So then I have this in the body of the page:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like-box
profile_id="***my ID here***"
width="450"
height="600"
colorscheme="dark"
show_faces="false"
stream="true"
header="false"
logobar="0"
css="http://***my domain here***/css/FBstyles.css?1"
href="http://www.facebook.com/***my page name here***"
></fb:like-box>
But I still get these sorts of errors:
"(4) Unsafe JavaScript attempt to access frame with URL ...(my webpage)...from frame with URL http://www.facebook.com/plugins/likebox.php?channel=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%3Fversion%3D2%23cb%3Dfd907a0e%26origin...blahblahblah. Domains, protocols and ports must match."
Where am I screwing up?
I went this route too. Although you are using FBML, the actual embedded code ends up being an iframe anyway. (you can see it in the DOM with an HTML inspector after it loads). About the only thing I was able to do was put it in a div with a colored background, since the iframe is transparent, and a border.
You are probably getting errors since the javascript on the Facebook server is trying to access the CSS on your server. I didn't think you could do this.
EDIT:
In the StackOverflow link you provided, the posted answers clearly state that using your own CSS only works with a "Fan" box, not with a "Like" box.

Visibility of byline in folder view in collages for plone 3.3.1

I'm currently in the process of setting up my plone site to show expiration dates for content items in folders. This is part of a process to keep track of old files and documents on our intranet.
I have already altered my "folder listing" to show the expiration date if there is one (or say there isn't if there is no such date) which works as I expected. Unfortunately I cannot seem to replicate this with one of my addons.
I am currently using an addon called collage (version 1.2.3) which basically allows us to have a combination of different sorts of content as main-pages. I'm not quite sure what it is about collages that does this but when they show the contents of folders they only seem to show the title and description.
Previously this was fine but now I want to show the expiration date from the byline. I've been searching through all the python files and views and I can't seem to find where it decides to cut off the byline but it does sound like it calls on the folder_listing file.
When I open up a page which uses a collage to show a folder and view the source the byline is there, but it doesn't show up in the final version for some reason.
If anyone knows collages or plone moderately well and has a thought about this I would greatly appreciate any insight.
As a reference, I altered my folder_list by including this underneath the entry for tal:modified:
<tal:expire condition="python: item_type != 'Event'">
—
<tal:mod tal:condition="python:toLocalizedTime(item_expire,long_format=1)" i18n:translate="box_when_expires">
Expires on
</tal:mod>
<span tal:condition="not: python:toLocalizedTime(item_expire,long_format=1)">
This item has no expiration date listed.
</span>
<span tal:replace="python:toLocalizedTime(item_expire,long_format=1)">
August 16, 2001 at 23:35:59
</span>
</tal:expire>
You should look at Collage CSS Products/Collage/browser/templates/collage.css.dtml
There is the following instruction which hides documentByLine
#collage .collage-item .documentByLine {
display: none;
}
I have overrided this rule to set display: block; in my own css.

Resources