Showing websites full HTML code - html

I'm trying to parse a html code for specific content, but the problem I'm running into is that certain websites require you to click a "Show more" button.
When I grab the URL there's no way to tell it I want the full code with the "Show more" button clicked. Is there a way to grab the full source code of the page, because it keeps getting cut off after a point.
Example website: https://play.google.com/store/search?q=fm%20radio&c=apps&hl=en
The source code gets cut off at the "Radio hungary" app, which is the last app that loads automatically.
This even happens when I load everything and then try to view the pages source code.
It ends in:
style="display:none"> Show More </button> <div class="bottom-loading" style="display:none"></div> <div class="footer"> <div class="footer-links-container"> <span class="copyright"> ©2016 Google</span> <a class="footer-link id-no-nav" href="https://play.google.com/intl/en_us/about/play-terms.html" target="_blank"> Site Terms of Service</a> <a class="footer-link id-no-nav" href="http://www.google.com/intl/en_us/policies/privacy/" target="_blank"> Privacy Policy</a> <a class="footer-link id-no-nav" href="http://developer.android.com/index.html" target="_blank"> Developers</a> <a class="footer-link id-no-nav" href="https://play.google.com/artists" target="_blank"> Artists</a> <a class="footer-link id-no-nav" href="https://support.google.com/googleplay/?p=about_play" target="_blank"> About Google</a> </div> </div> </div></div><div class="loading" jscontroller="EgJAl" jsaction="rcuQ6b:rcuQ6b" id="page-load-indicator"></div><div id="instrument-manager-parent"></div><script src="https://wallet.google.com/inapp/lib/buy.js"></script><script
Even if I click the show more button.
The purpose of this is to grab all the URL's of the images, and I can't do this by hand because well.. we have thousands of images.

I believe if you just take advantage of the Javascript HTML DOM methods you can accomplish what you want to achieve.
This will help: http://www.w3schools.com/js/js_htmldom_methods.asp
By using this, you can target specific elements/ids/classes and pull or modify the information you want.
Jquery will also help you a lot with this.

You can solve it using Javascript dom,steps to do are
keep your content in a div element
set its default height as a fixed value
on clicking the show more link execute a javascript function to make the div element height to auto
in this way you can show content excerpt with javascript
If you go for server side, you can create a new page for showing the content.

Related

Strange hidden span appear in Wordpress website

I am managing a Wordpress-powered website for my faculty. Today when I share a link of the website to my student, I discovered that there is a hidden span element in the code of the site, and it only shows up in the sharing preview (Open Graph or Facebook Graph) if the content of the page is short enough
The span element look like this:
<span class="keys_words" style="display: none;">
<a class="links_good_rands" href="some random link">Some random text</a>
|
<a class="links_good_rands" href="some random link">Some random text</a>
</span>
I have tried deactivating all plugins and changing the theme, but the element persists. Google search results don't really help, either.
The website is http://ngoaingu.vimaru.edu.vn/. The code is injected at the end of the main entry content.
Can anyone check this out and help me get rid of this strange element?

href link working for one item but not for another

I have an index.html that includes:
<li>
<a href="imprint.html#imprint-link">
<div class="main-menu-title">IMPRINT</div>
</a>
</li>
When I click on this item another html file (imprint.html) is loaded, but when I click on Home, which includes the following code to go back to index.html, it doesn't work!
<a href="#index-link">
<div class="main-menu-title">HOME</div>
</a>
What is wrong here?
Update 1: When hovering the mouse over the link I get:
try using this code :
<a href="index.html">
<div class="main-menu-title">HOME</div>
</a>
inplace of :
<a href="#index-link">
<div class="main-menu-title">HOME</div>
</a>
To answer your original question.
What's wrong here?
As a couple kind folks already commented and one person already provided a nice solution, clicking on your original link
href="#index-link"
while you are on the imprint.html page will not take you to your index.html page. Why? Because
<a href="#index-link">
<div class="main-menu-title">HOME</div>
</a>
is saying, "Take me to an element on the current page (imprint.html) that has an ID of 'index-link'. If there is no element with and ID set to index-link, on the imprint.html page, nothing will happen. And, you will stay on the current page because you didn't specify an URL outside of the current page, which is still imprint.html.
So, with that current setup, you will not get to see index.html.

Printable tab button

I'm currently stuck with some HTML code. On my website, I currently have 5 existing tabs but I wanted to make one clickable that redirects the user to a printable page that pops open the print menu specific to their browsing. I think I may be missing something in my HTML code. Underneath you can find a simplified version I extracted from one of my tabs:
<div class="tab-item">
<a class="tab-label text-center"><i class="icon-1-map"></i> Ligging</a>
<div class="tab-content">
<iframe src="<!--GOOGLE MAPS LINK-->" style="width:100%; height:400px; frameborder:0; border:0" allowfullscreen></iframe>
</div>
</div>
I wanted to implement something like this
<div class="tab-item">
<a href="../../print/k420-torhoutsesteenweg306.html">
<i class="icon-1-print"></i> Print deze pagina
</a>
</div>
The problem is, sometimes the tab doesn't even show up and if I change my code to the one underneath, it doesn't bring me to the linked page.
<div class="tab-item">
<a class="tab-label text-center" href="../../print/k420-torhoutsesteenweg306.html">
<i class="icon-1-print"></i> Print deze pagina
</a>
</div>
Can anybody help me?
If you'd like to see the full sourcecode, please click here
Thanks!
Welcome to StackOverflow.
1) To just open the print dialogue of the page upon loading, simply add this at the bottom of your HTML's <body> : <script>window.print()</script>
2) As for your disappearing code, please provide more information and/or link your CSS. Also, why are you using <i> on its own like that? <i> is to display text in italics
The information you provide is not enough to correct any issues.

Applying AddThis buttons

I want to add AddThis, social bookmarking service, to my site. I followed the instruction on the site. There is an option where you can select your own services and customize the order.
I selected facebook, twitter, google, linked in, pinterest and whatsapp.
As instructed, I added
<script type="text/javascript" src="https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-53353be15c66b7b4" async="async"></script>
inside the head tag just before closing.
Then, where I need the buttons to show, I added
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_preferred_5"></a>
<a class="addthis_button_preferred_6"></a>
</div>
The end result:
It shows a few buttons that I haven't selected.
I must be doing something wrong and spent the whole day looking into it. Can you help.
Not Seeing the Buttons You Expected? It’s Because Smart Layers are Personalized
One of the key features of our new Smart Layers is something you can’t
actually see. All the share buttons are personalized to each visitor.
This makes it much more likely that people will share your site.
-source: http://www.addthis.com/blog/2013/07/30/not-seeing-the-buttons-you-want/
So basically what it means is that if a particular user is know to use a particular social service more, only those buttons will be shown to that person. Filtering appears to be done at a low level.
Have a look at other similar services.
Your problem is that you are manually setting the icons on your page. Considering you are selecting your services via the addthis.com website, simply add the following div element to your page, in place of your current addthis code:
<div class="addthis_sharing_toolbox"></div>
That div will get filled automatically with the services you selected from addthis.com, trust me on this one I got this.
I am Elsa from the AddThis support team.
If you were using the default AddThis configuration it's using what we call Preferred Services. These are different for each individual based on their past sharing history and what services are most popular in our service. This is designed to make it easy for users to share to their preferred service and to increase sharing.
If you want to show up the dashboard configured sharing button in your website then Replace the below code
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_preferred_5"></a>
<a class="addthis_button_preferred_6"></a>
</div>
with the below inline HTML code of that tool.
<div class="addthis_sharing_toolbox"></div>

How can I get an html table cell that is a link to contain text and another link?

I'm trying to get a table cell that is one big href to contain two things - an icon that opens a popup (at location A), and some text that follows the cell's href (to location B). However I can't quite get it working.
Here's the HTML I have that only works for the icon/popup:
<table><tr><td>
<a href="http://www.google.com>
<span>
<a onclick="window.open('http://www.yahoo.com', location=no,scrollbars=no,menubar=no,toolbar=no,status=no,resizable=yes')">
<img src="smiley.png" />
</a>
</span>
Go to Google
</a>
</td></tr></table>
This works fine for clicking on the smiley icon and opening the yahoo popup, but clicking on "Go to Google" doesn't do anything.
Here's the HTML I have that works for following the href:
<table><tr><td>
<a href="http://www.google.com>
<img src="smiley.png" />
Go to Google
</a>
</td></tr></table>
This follows the href no matter what I click on in the cell (which makes sense, there's only one href).
I also tried this, but clicking on the icon would both open the popup and follow the href:
<table><tr><td>
<a href="http://www.google.com>
<img src="smiley.png" onclick="window.open('http://www.yahoo.com', location=no,scrollbars=no,menubar=no,toolbar=no,status=no,resizable=yes')"/>
Go to Google
</a>
</td></tr></table>
Any help?
You can't just have a link contain another link. Have two links, but separated. Use CSS to make them fill the cell if you have to.